﻿namespace ACCOUNTING
{
    using ACCOUNTING.LVY.Business;
    using ACCOUNTING.My;
    using ACCOUNTING.My.Resources;
    using C1.Win.C1Command;
    using C1.Win.C1FlexGrid;
    using C1.Win.C1FlexGrid.Util.BaseControls;
    using C1.Win.C1Input;
    using Microsoft.VisualBasic;
    using Microsoft.VisualBasic.CompilerServices;
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Diagnostics;
    using System.Drawing;
    using System.Runtime.CompilerServices;
    using System.Windows.Forms;

    [DesignerGenerated]
    public class Frm_HoaDonMuaDichVu2 : Form
    {
        #region field
        private static List<WeakReference> __ENCList = new List<WeakReference>();
        [AccessedThroughProperty("AdvNhaCungCap")]
        private ADVObjects _AdvNhaCungCap;
        [AccessedThroughProperty("AdvTaiKhoanCo")]
        private ADVAccount _AdvTaiKhoanCo;
        [AccessedThroughProperty("AdvTaiKhoanThue")]
        private ADVAccount _AdvTaiKhoanThue;
        [AccessedThroughProperty("C1DockingTab1")]
        private C1DockingTab _C1DockingTab1;
        [AccessedThroughProperty("C1DockingTab2")]
        private C1DockingTab _C1DockingTab2;
        [AccessedThroughProperty("C1DockingTabPage1")]
        private C1DockingTabPage _C1DockingTabPage1;
        [AccessedThroughProperty("C1DockingTabPage2")]
        private C1DockingTabPage _C1DockingTabPage2;
        [AccessedThroughProperty("CboKhaiThue")]
        private ComboBox _CboKhaiThue;
        [AccessedThroughProperty("CboLoaiHoaDon")]
        private ComboBox _CboLoaiHoaDon;
        [AccessedThroughProperty("CboLoaiTien")]
        private ComboBox _CboLoaiTien;
        [AccessedThroughProperty("CKTheoDoiSeri")]
        private CheckBox _CKTheoDoiSeri;
        [AccessedThroughProperty("CmdAdd")]
        private ToolStripButton _CmdAdd;
        [AccessedThroughProperty("CmdAddRow")]
        private Button _CmdAddRow;
        [AccessedThroughProperty("CmdCopy")]
        private Button _CmdCopy;
        [AccessedThroughProperty("CmdDel")]
        private ToolStripButton _CmdDel;
        [AccessedThroughProperty("CmdDelRow")]
        private Button _CmdDelRow;
        [AccessedThroughProperty("CmdEdit")]
        private ToolStripButton _CmdEdit;
        [AccessedThroughProperty("CmdExit")]
        private ToolStripButton _CmdExit;
        [AccessedThroughProperty("CmdFind")]
        private ToolStripButton _CmdFind;
        [AccessedThroughProperty("cmdHelp")]
        private ToolStripButton _cmdHelp;
        [AccessedThroughProperty("CmdPrint")]
        private ToolStripButton _CmdPrint;
        [AccessedThroughProperty("CmdSave")]
        private ToolStripButton _CmdSave;
        [AccessedThroughProperty("CmdTimDonHang")]
        private Button _CmdTimDonHang;
        [AccessedThroughProperty("CmdUnsave")]
        private ToolStripButton _CmdUnsave;
        [AccessedThroughProperty("Label1")]
        private Label _Label1;
        [AccessedThroughProperty("Label10")]
        private Label _Label10;
        [AccessedThroughProperty("Label11")]
        private Label _Label11;
        [AccessedThroughProperty("Label12")]
        private Label _Label12;
        [AccessedThroughProperty("Label13")]
        private Label _Label13;
        [AccessedThroughProperty("Label14")]
        private Label _Label14;
        [AccessedThroughProperty("Label15")]
        private Label _Label15;
        [AccessedThroughProperty("Label16")]
        private Label _Label16;
        [AccessedThroughProperty("Label17")]
        private Label _Label17;
        [AccessedThroughProperty("Label18")]
        private Label _Label18;
        [AccessedThroughProperty("Label2")]
        private Label _Label2;
        [AccessedThroughProperty("Label20")]
        private Label _Label20;
        [AccessedThroughProperty("Label22")]
        private Label _Label22;
        [AccessedThroughProperty("Label23")]
        private Label _Label23;
        [AccessedThroughProperty("Label24")]
        private Label _Label24;
        [AccessedThroughProperty("Label3")]
        private Label _Label3;
        [AccessedThroughProperty("Label4")]
        private Label _Label4;
        [AccessedThroughProperty("Label5")]
        private Label _Label5;
        [AccessedThroughProperty("Label6")]
        private Label _Label6;
        [AccessedThroughProperty("Label7")]
        private Label _Label7;
        [AccessedThroughProperty("Label8")]
        private Label _Label8;
        [AccessedThroughProperty("Label9")]
        private Label _Label9;
        [AccessedThroughProperty("LinkLabel1")]
        private LinkLabel _LinkLabel1;
        [AccessedThroughProperty("Panel4")]
        private Panel _Panel4;
        [AccessedThroughProperty("Panel5")]
        private Panel _Panel5;
        [AccessedThroughProperty("ToolStrip1")]
        private ToolStrip _ToolStrip1;
        [AccessedThroughProperty("ToolStripButton1")]
        private ToolStripSeparator _ToolStripButton1;
        [AccessedThroughProperty("ToolStripSeparator1")]
        private ToolStripSeparator _ToolStripSeparator1;
        [AccessedThroughProperty("ToolStripSeparator2")]
        private ToolStripSeparator _ToolStripSeparator2;
        [AccessedThroughProperty("ToolStripSeparator3")]
        private ToolStripSeparator _ToolStripSeparator3;
        [AccessedThroughProperty("TxtChietKhau")]
        private C1NumericEdit _TxtChietKhau;
        [AccessedThroughProperty("TxtChietKhauNT")]
        private C1NumericEdit _TxtChietKhauNT;
        [AccessedThroughProperty("TxtDienGiai")]
        private TextBox _TxtDienGiai;
        [AccessedThroughProperty("TxtMaSoThue")]
        private TextBox _TxtMaSoThue;
        [AccessedThroughProperty("TxtNgayChungTu")]
        private DateTimePicker _TxtNgayChungTu;
        [AccessedThroughProperty("TxtNgayDathang")]
        private DateTimePicker _TxtNgayDathang;
        [AccessedThroughProperty("TxtNgayHoaDon")]
        private DateTimePicker _TxtNgayHoaDon;
        [AccessedThroughProperty("TxtNgayToiHanThanhToan")]
        private DateTimePicker _TxtNgayToiHanThanhToan;
        [AccessedThroughProperty("TxtNguoiGiao")]
        private TextBox _TxtNguoiGiao;
        [AccessedThroughProperty("TxtSoChungTu")]
        private TextBox _TxtSoChungTu;
        [AccessedThroughProperty("TxtSoDonHang")]
        private TextBox _TxtSoDonHang;
        [AccessedThroughProperty("TxtSoHoaDon")]
        private TextBox _TxtSoHoaDon;
        [AccessedThroughProperty("TxtSoNgayToiHan")]
        private TextBox _TxtSoNgayToiHan;
        [AccessedThroughProperty("TxtSoSeri")]
        private TextBox _TxtSoSeri;
        [AccessedThroughProperty("TxtThueSuat")]
        private C1NumericEdit _TxtThueSuat;
        [AccessedThroughProperty("TxtTienHang")]
        private C1NumericEdit _TxtTienHang;
        [AccessedThroughProperty("TxtTienHangNT")]
        private C1NumericEdit _TxtTienHangNT;
        [AccessedThroughProperty("TxtTienThue")]
        private C1NumericEdit _TxtTienThue;
        [AccessedThroughProperty("TxtTienThueNT")]
        private C1NumericEdit _TxtTienThueNT;
        [AccessedThroughProperty("TxtTongThanhToan")]
        private C1NumericEdit _TxtTongThanhToan;
        [AccessedThroughProperty("TxtTongThanhToanNT")]
        private C1NumericEdit _TxtTongThanhToanNT;
        [AccessedThroughProperty("txtTyGia")]
        private C1NumericEdit _txtTyGia;
        [AccessedThroughProperty("VSList")]
        private C1.Win.C1FlexGrid.C1FlexGrid _VSList;
        private string cFrmFormat;
        public string cFrmKhoa;
        private string cFrmKhoaOld;
        public int cFrmPhanBoChietKhau;
        private string cFrmTask;
        private IContainer components;
        private bool mAllowAdd;
        private bool mAllowDel;
        private bool mAllowEdit;
        private bool mAllowView;
        private bool mEnabledControl;
        private string mLoaiChungTu;
        private clsDMLoaiTien objLT;
        private clsNhapKho objNK;
        private clsNhapKhoChiTiet objNKCT;
        private clsNhapKhoChiTietDichVu objNKDV;
        private clsSoChungTu objSoCT;
        ComponentResourceManager manager;
        #endregion 
        public Frm_HoaDonMuaDichVu2()
        {
            base.KeyDown += new KeyEventHandler(this.Frm_NhapKho_KeyDown);
            base.Load += new EventHandler(this.Frm_NhapKho_Load);
            List<WeakReference> list = __ENCList;
            lock (list)
            {
                __ENCList.Add(new WeakReference(this));
            }
            this.mLoaiChungTu = "NKDV";
            this.objSoCT = new clsSoChungTu();
            this.cFrmKhoa = "";
            this.cFrmKhoaOld = "";
            this.objNK = new clsNhapKho();
            this.objNKCT = new clsNhapKhoChiTiet();
            this.objNKDV = new clsNhapKhoChiTietDichVu();
            this.cFrmTask = "";
            this.cFrmPhanBoChietKhau = 0;
            this.objLT = new clsDMLoaiTien();
            this.InitializeComponent();
        }

        private void AdvNhaCungCap_ValueChanged(object sender, EventArgs e)
        {
            clsDMDoiTuong tuong = new clsDMDoiTuong();
            tuong.Load(this.AdvNhaCungCap.Value);
            this.TxtMaSoThue.Text = tuong.MaSoThue;
        }

        private void CboLoaiHoaDon_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.CboLoaiHoaDon.SelectedValue), "", modGeneral.TypeOfValue.Nothing).ToString().Trim() != "")
            {
                clsDMLoaiHoaDon don = new clsDMLoaiHoaDon();
                don.Load(this.CboLoaiHoaDon.SelectedValue.ToString());
                this.TxtThueSuat.Value = don.TyLeThue;
                int num2 = this.VSList.Rows.Count - 1;
                for (int i = 1; i <= num2; i++)
                {
                    this.VSList[i, 11] = RuntimeHelpers.GetObjectValue(this.TxtThueSuat.Value);
                    RowColEventArgs args = new RowColEventArgs(i, 11);
                    this.VSList_AfterEdit(this.VSList, args);
                }
            }
        }

        private void CboLoaiTien_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.CboLoaiTien.SelectedValue), "", modGeneral.TypeOfValue.Nothing).ToString().Trim() == "")
            {
                this.txtTyGia.Value = 0;
            }
            else
            {
                string strCode = LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.CboLoaiTien.SelectedValue), "", modGeneral.TypeOfValue.Nothing).ToString().Trim();
                if (strCode != "")
                {
                    clsDMLoaiTien tien = new clsDMLoaiTien();
                    tien.LoadByCode(strCode);
                    if (tien.SoLe > 0)
                    {
                        this.cFrmFormat = modGeneral.H_FORMATNUMBER + "." + LVYModule.sRight("0000000000", tien.SoLe);
                    }
                    if (tien.TienViet == 1)
                    {
                        this.txtTyGia.Enabled = false;
                    }
                    else
                    {
                        this.txtTyGia.Enabled = true;
                    }
                    this.txtTyGia.Value = tien.TyGia;
                    this.FormatNumber();
                }
            }
        }

        public bool CheckGrid()
        {
            if (this.VSList.Rows.Count == 1)
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Bạn chưa nhập h\x00e0ng h\x00f3a nhập kho!", ""));
                this.CmdAddRow.Focus();
                return false;
            }
            int num2 = this.VSList.Rows.Count - 1;
            for (int i = 1; i <= num2; i++)
            {
                if (LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSList[i, 1]), "", modGeneral.TypeOfValue.Nothing).ToString().Trim() == "")
                {
                    LVYModule.ShowWarning(modGeneral.Tranlated("Bạn phải nhập số t\x00e0i khoản!", ""));
                    this.VSList.Focus();
                    this.VSList.Select(i, 2);
                    return false;
                }
                if (LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSList[i, 3]), "", modGeneral.TypeOfValue.Nothing).ToString().Trim() == "")
                {
                    LVYModule.ShowWarning(modGeneral.Tranlated("Bạn phải nhập t\x00ean dịch vụ mua v\x00e0o!", ""));
                    this.VSList.Focus();
                    this.VSList.Select(i, 3);
                    return false;
                }
            }
            return true;
        }

        public bool CheckIvalid()
        {
            if (!LVYModule.CheckDateLock(LVYModule.Date2Char(this.TxtNgayChungTu.Text)))
            {
                return false;
            }
            if (LVYModule.ReturnIfNull(this.TxtSoChungTu.Text, "", modGeneral.TypeOfValue.Nothing).ToString().Trim() == "")
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Số chứng từ kh\x00f4ng được để trống! Bạn vui l\x00f2ng nhập số chứng từ.", ""));
                this.TxtSoChungTu.Focus();
            }
            if (this.objNK.IsDuplicateVoucherNo(this.TxtSoChungTu.Text, this.cFrmKhoa))
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Số chứng từ bị tr\x00f9ng! Bạn vui l\x00f2ng nhập số chứng từ kh\x00e1c.", ""));
                this.TxtSoChungTu.Focus();
                return false;
            }
            if (!LVYModule.CheckDateLock(LVYModule.Date2Char(this.TxtNgayChungTu.Text)))
            {
                return false;
            }
            if (LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.CboLoaiTien.SelectedValue), "", modGeneral.TypeOfValue.Nothing).ToString().Trim() == "")
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Bạn vui l\x00f2ng nhập loại nguy\x00ean tệ hạch to\x00e1n!", ""));
                this.CboLoaiTien.Focus();
                return false;
            }
            if (Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.txtTyGia.Value), 0, modGeneral.TypeOfValue.Nothing)) == 0.0)
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Bạn vui l\x00f2ng nhập tỷ gi\x00e1 nguy\x00ean tệ!", ""));
                this.txtTyGia.Focus();
                return false;
            }
            if (LVYModule.ReturnIfNull(this.AdvNhaCungCap.Value, "", modGeneral.TypeOfValue.Nothing).ToString().Trim() == "")
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Bạn vui l\x00f2ng nhập nh\x00e0 cung cấp!", ""));
                this.AdvNhaCungCap.Focus();
                return false;
            }
            if (this.AdvTaiKhoanCo.Value.Trim() == "")
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Bạn vui l\x00f2ng nhập t\x00e0i khoản thanh to\x00e1n!", ""));
                this.AdvTaiKhoanCo.Focus();
                return false;
            }
            if (this.AdvTaiKhoanThue.Value.Trim() == "")
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Bạn vui l\x00f2ng nhập t\x00e0i khoản thuế!", ""));
                this.AdvTaiKhoanThue.Focus();
                return false;
            }
            if (!this.CheckGrid())
            {
                return false;
            }
            return true;
        }

        private void CKTheoDoiSeri_CheckedChanged(object sender, EventArgs e)
        {
            if (this.CKTheoDoiSeri.CheckState == CheckState.Checked)
            {
                this.VSList.Cols[7].Visible = true;
            }
            else
            {
                this.VSList.Cols[7].Visible = false;
            }
        }

        private void CmdAdd_Click(object sender, EventArgs e)
        {
            if (this.cFrmKhoa.Trim() != "")
            {
                this.cFrmKhoaOld = this.cFrmKhoa;
            }
            this.EmptyData();
            this.cFrmKhoa = modGeneral.CreatKey("ST_NhapKho", 15, "SE");
            this.objSoCT.Load(this.mLoaiChungTu);
            this.TxtSoChungTu.Text = this.objSoCT.CreateVoucher(LVYModule.sLeft(LVYModule.Date2Char(this.TxtNgayChungTu.Text), 6), 1);
            this.CboLoaiTien.SelectedValue = modGeneral.H_CURRENCY;
            this.InitDefault();
            this.EnabledControl = true;
            this.TxtSoChungTu.Focus();
            this.cFrmTask = "I";
        }

        private void CmdAddRow_Click(object sender, EventArgs e)
        {
            if (LVYModule.ReturnIfNull(this.AdvNhaCungCap.Value, "", modGeneral.TypeOfValue.Nothing).ToString().Trim() == "")
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Bạn phải chọn nh\x00e0 cung cấp!", ""));
                this.AdvNhaCungCap.Focus();
            }
            else if (LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.CboLoaiTien.SelectedValue), "", modGeneral.TypeOfValue.String).ToString().Trim() == "")
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Bạn phải chọn loại tiền!", ""));
                this.CboLoaiTien.Focus();
            }
            else
            {
                this.VSList.AddItem("");
                this.VSList[this.VSList.Rows.Count - 1, 11] = RuntimeHelpers.GetObjectValue(this.TxtThueSuat.Value);
                this.VSList.Select(this.VSList.Rows.Count - 1, 2);
                this.VSList.Focus();
            }
        }

        private void CmdChiPhi_Click(object sender, EventArgs e)
        {
            MyProject.Forms.Frm_ChiPhiMuaHang.cFrmKhoaPhieuNhap = this.cFrmKhoa;
            MyProject.Forms.Frm_ChiPhiMuaHang.ShowDialog();
            this.objNK.Load(this.cFrmKhoa);
        }

        private void CmdCopy_Click(object sender, EventArgs e)
        {
            if ((this.VSList.Rows.Count != 1) && (this.VSList.Row > 0))
            {
                this.VSList.AddItem("");
                int num2 = this.VSList.Cols.Count - 1;
                for (int i = 0; i <= num2; i++)
                {
                    this.VSList[this.VSList.Rows.Count - 1, i] = RuntimeHelpers.GetObjectValue(this.VSList[this.VSList.Row, i]);
                    this.VSList[this.VSList.Rows.Count - 1, 0] = "";
                    this.VSList[this.VSList.Rows.Count - 1, 7] = "";
                }
            }
        }

        private void CmdDel_Click(object sender, EventArgs e)
        {
            if (LVYModule.ReturnIfNull(this.cFrmKhoa, "", modGeneral.TypeOfValue.Nothing).ToString().Trim() != "")
            {
                if (this.objNK.TienPhiNhap != 0.0)
                {
                    LVYModule.ShowWarning(modGeneral.Tranlated("Th\x00f4ng tin n\x00e0y đ\x00e3 được xử l\x00fd. Bạn kh\x00f4ng thể chỉnh sửa hay x\x00f3a!", ""));
                }
                else if (LVYModule.ConfirmDelete("") && this.objNK.DeleteData(this.cFrmKhoa))
                {
                    this.EmptyData();
                }
            }
        }

        private void CmdDelRow_Click(object sender, EventArgs e)
        {
            if (this.VSList.Rows.Count != 1)
            {
                this.VSList.RemoveItem(this.VSList.Row);
            }
        }

        private void CmdEdit_Click(object sender, EventArgs e)
        {
            if (LVYModule.CheckDateLock(LVYModule.Date2Char(this.TxtNgayChungTu.Text)) && (LVYModule.ReturnIfNull(this.cFrmKhoa, "", modGeneral.TypeOfValue.Nothing).ToString().Trim() != ""))
            {
                if (this.objNK.TienPhiNhap != 0.0)
                {
                    LVYModule.ShowWarning(modGeneral.Tranlated("Th\x00f4ng tin n\x00e0y đ\x00e3 được xử l\x00fd. Bạn kh\x00f4ng thể chỉnh sửa hay x\x00f3a!", ""));
                }
                else
                {
                    this.cFrmKhoaOld = this.cFrmKhoa;
                    this.cFrmTask = "U";
                    this.EnabledControl = true;
                }
            }
        }

        private void CmdExit_Click(object sender, EventArgs e)
        {
            this.Dispose();
        }

        private void CmdFind_Click(object sender, EventArgs e)
        {
            MyProject.Forms.Frm_HoaDonMuaDichVuList.Show();
            MyProject.Forms.Frm_HoaDonMuaDichVuList.BringToFront();
        }

        private void CmdPrint_Click(object sender, EventArgs e)
        {
            ReportModule.PrintHoaDonMuaDichVu(this.cFrmKhoa);
        }

        private void CmdSave_Click(object sender, EventArgs e)
        {
            if (this.CheckIvalid())
            {
                if (!this.SaveDVDetailsTemp())
                {
                    this.objNK.ClearTemp(this.cFrmKhoa);
                }
                else if (Conversions.ToBoolean(Microsoft.VisualBasic.CompilerServices.Operators.NotObject(this.UpdateData())))
                {
                    this.objNK.ClearTemp(this.cFrmKhoa);
                }
                else
                {
                    this.objNK.ClearTemp(this.cFrmKhoa);
                    this.cFrmTask = "";
                    this.EnabledControl = false;
                }
            }
        }

        private void CmdTimDonHang_Click(object sender, EventArgs e)
        {
            MyProject.Forms.Frm_DonDatHangMuaList.Dispose();
            MyProject.Forms.Frm_DonDatHangMuaList.objFrmCall = this;
            MyProject.Forms.Frm_DonDatHangMuaList.strConditions = " AND DH.TinhTrang = 'CK'";
            MyProject.Forms.Frm_DonDatHangMuaList.ShowDialog();
            MyProject.Forms.Frm_DonDatHangMuaList.Dispose();
        }

        private void CmdUnsave_Click(object sender, EventArgs e)
        {
            if (LVYModule.ReturnIfNull(this.cFrmKhoaOld, "", modGeneral.TypeOfValue.Nothing).ToString().Trim() != "")
            {
                this.cFrmKhoa = this.cFrmKhoaOld;
                this.ShowData(this.cFrmKhoa);
            }
            else
            {
                this.EmptyData();
            }
            if (this.cFrmTask == "I")
            {
                this.objSoCT.UndoVoucher(LVYModule.sLeft(LVYModule.Date2Char(this.TxtNgayChungTu.Text), 6));
            }
            this.cFrmTask = "";
            this.EnabledControl = false;
        }

        [DebuggerNonUserCode]
        protected override void Dispose(bool disposing)
        {
            if (disposing && (this.components != null))
            {
                this.components.Dispose();
            }
            base.Dispose(disposing);
        }

        public void EmptyData()
        {
            this.objNK.SetBlank();
            this.TxtSoChungTu.Text = "";
            this.TxtNgayChungTu.Text = Strings.Format(DateAndTime.Today, "dd/MM/yyyy");
            this.CboLoaiTien.SelectedValue = "";
            this.txtTyGia.Value = 0;
            this.TxtDienGiai.Text = "";
            this.TxtNguoiGiao.Text = "";
            this.CboLoaiHoaDon.SelectedValue = "";
            this.TxtSoSeri.Text = "";
            this.TxtSoHoaDon.Text = "";
            this.TxtNguoiGiao.Text = "";
            this.AdvTaiKhoanCo.Value = "";
            this.AdvTaiKhoanThue.Value = "";
            this.AdvNhaCungCap.Value = "";
            this.VSList.Select(0, 1);
            this.VSList.Rows.Count = 1;
            this.TxtTienHangNT.Value = 0;
            this.TxtTienHang.Value = 0;
            this.TxtTienThueNT.Value = 0;
            this.TxtTienThue.Value = 0;
            this.TxtTongThanhToan.Value = 0;
            this.TxtTongThanhToanNT.Value = 0;
        }

        public void FormatNumber()
        {
            LVYModule.advFormatNumber(this.txtTyGia, this.cFrmFormat);
            LVYModule.advFormatNumber(this.TxtTienHangNT, this.cFrmFormat);
            LVYModule.advFormatNumber(this.TxtTienHang, modGeneral.H_FORMATNUMBER);
            LVYModule.advFormatNumber(this.TxtTienThueNT, this.cFrmFormat);
            LVYModule.advFormatNumber(this.TxtTienThue, modGeneral.H_FORMATNUMBER);
            LVYModule.advFormatNumber(this.TxtTongThanhToanNT, this.cFrmFormat);
            LVYModule.advFormatNumber(this.TxtTongThanhToan, modGeneral.H_FORMATNUMBER);
            LVYModule.advFormatNumber(this.TxtChietKhauNT, this.cFrmFormat);
            LVYModule.advFormatNumber(this.TxtChietKhau, modGeneral.H_FORMATNUMBER);
            this.VSList.Cols[8].Format = this.cFrmFormat;
            this.VSList.Cols[10].Format = this.cFrmFormat;
            this.VSList.Cols[8].Format = modGeneral.H_FORMATNUMBER;
            this.VSList.Cols[12].Format = modGeneral.H_FORMATNUMBER;
        }

        private void Frm_NhapKho_KeyDown(object sender, KeyEventArgs e)
        {
            Keys keyCode = e.KeyCode;
            if (keyCode == Keys.Escape)
            {
                if (this.CmdExit.Enabled)
                {
                    this.CmdExit_Click(RuntimeHelpers.GetObjectValue(sender), e);
                }
            }
            else if (keyCode == Keys.F2)
            {
                if (this.CmdEdit.Enabled)
                {
                    this.CmdEdit_Click(RuntimeHelpers.GetObjectValue(sender), e);
                }
            }
            else if (keyCode == Keys.F3)
            {
                this.CmdFind_Click(RuntimeHelpers.GetObjectValue(sender), e);
            }
            else if (keyCode == Keys.F8)
            {
                if (this.CmdAdd.Enabled)
                {
                    this.CmdAdd_Click(RuntimeHelpers.GetObjectValue(sender), e);
                }
            }
            else if (keyCode == Keys.F9)
            {
                if (this.CmdDel.Enabled)
                {
                    this.CmdDel_Click(RuntimeHelpers.GetObjectValue(sender), e);
                }
            }
            else if (keyCode == Keys.F10)
            {
                if (this.CmdSave.Enabled)
                {
                    this.CmdSave_Click(RuntimeHelpers.GetObjectValue(sender), e);
                }
            }
            else if (keyCode == Keys.F11)
            {
                if (this.CmdUnsave.Enabled)
                {
                    this.CmdUnsave_Click(RuntimeHelpers.GetObjectValue(sender), e);
                }
            }
            else if ((keyCode == Keys.F12) && this.CmdPrint.Enabled)
            {
                this.CmdPrint_Click(RuntimeHelpers.GetObjectValue(sender), e);
            }
        }

        private void Frm_NhapKho_Load(object sender, EventArgs e)
        {
            this.Cursor = Cursors.WaitCursor;
            LVYModule.GetUserRight(ref this.mAllowView, ref this.mAllowDel, ref this.mAllowEdit, ref this.mAllowAdd, Conversions.ToString(this.Tag), modGeneral.H_USERNAME);
            if (!this.mAllowView)
            {
                this.Cursor = Cursors.Default;
                LVYModule.ShowWarning(modGeneral.Tranlated("Bạn kh\x00f4ng c\x00f3 quyền xem, li\x00ean hệ với người quản trị để biết th\x00eam chi tiết.", ""));
                this.Dispose();
            }
            else
            {
                SetEvents();
                this.EnabledControl = false;
                this.KeyPreview = true;
                this.cFrmFormat = modGeneral.H_FORMATNUMBER;
                BuildComboModule.BuildCombo(this.CboLoaiTien, modGeneral.ListDanhMuc.LoaiTien, false, "", "");
                BuildComboModule.BuildCombo(this.CboLoaiHoaDon, modGeneral.ListDanhMuc.LoaiHoaDon, false, " LoaiPhatSinh = 'MV'", "");
                BuildComboModule.BuildCombo(this.CboKhaiThue, modGeneral.ListDanhMuc.HangMucBaoCaoThue, false, " LoaiPhatSinh = 'MV' ", "");
                if (LVYModule.ReturnIfNull(this.cFrmKhoa, "", modGeneral.TypeOfValue.Nothing).ToString().Trim() != "")
                {
                    this.ShowData(this.cFrmKhoa);
                }
                this.Cursor = Cursors.Default;
            }
        }

        private void SetEvents()
        {
            this._AdvNhaCungCap.ValueChanged += this.AdvNhaCungCap_ValueChanged;
            this._CboLoaiHoaDon.SelectedIndexChanged += this.CboLoaiHoaDon_SelectedIndexChanged;
            this._CboLoaiTien.SelectedIndexChanged += this.CboLoaiTien_SelectedIndexChanged;
            this._CmdAdd.Click += this.CmdAdd_Click;
            this._CmdCopy.Click += this.CmdCopy_Click;
            this._CmdDelRow.Click += this.CmdDelRow_Click;
            this._CmdEdit.Click += this.CmdEdit_Click;
            this._CmdExit.Click += this.CmdExit_Click;
            this._CmdFind.Click += this.CmdFind_Click;
            this._CmdPrint.Click += this.CmdPrint_Click;
            this._CmdSave.Click += this.CmdSave_Click;
            this._CmdTimDonHang.Click += this.CmdTimDonHang_Click;
            this._CmdUnsave.Click += this.CmdUnsave_Click;
            this._TxtSoNgayToiHan.LostFocus += this.TxtSoNgayToiHan_LostFocus;
            this._TxtSoSeri.KeyPress += this.TxtSoSeri_KeyPress;
            this._TxtThueSuat.ValueChanged += this.TxtThueSuat_ValueChanged;
            this._VSList.AfterEdit += this.VSList_AfterEdit;
            this._VSList.BeforeEdit += this.VSList_BeforeEdit;
            this._CmdAddRow.Click += this.CmdAddRow_Click;
        }

        public void InitDefault()
        {
            this.AdvTaiKhoanCo.Value = modGeneral.H_DEFAULT.Item("H_NK_TKCHU").GiaTri.ToString().Trim();
            this.AdvTaiKhoanThue.Value = modGeneral.H_DEFAULT.Item("H_NK_TKTHUE").GiaTri.ToString().Trim();
        }

        [DebuggerStepThrough]
        private void InitializeComponent()
        {
            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Frm_HoaDonMuaDichVu));
            this._ToolStrip1 = new System.Windows.Forms.ToolStrip();
            this._CmdAdd = new System.Windows.Forms.ToolStripButton();
            this._CmdEdit = new System.Windows.Forms.ToolStripButton();
            this._ToolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator();
            this._CmdSave = new System.Windows.Forms.ToolStripButton();
            this._CmdUnsave = new System.Windows.Forms.ToolStripButton();
            this._ToolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
            this._CmdFind = new System.Windows.Forms.ToolStripButton();
            this._CmdPrint = new System.Windows.Forms.ToolStripButton();
            this._ToolStripButton1 = new System.Windows.Forms.ToolStripSeparator();
            this._CmdDel = new System.Windows.Forms.ToolStripButton();
            this._ToolStripSeparator3 = new System.Windows.Forms.ToolStripSeparator();
            this._CmdExit = new System.Windows.Forms.ToolStripButton();
            this._cmdHelp = new System.Windows.Forms.ToolStripButton();
            this._C1DockingTab1 = new C1.Win.C1Command.C1DockingTab();
            this._C1DockingTabPage1 = new C1.Win.C1Command.C1DockingTabPage();
            this._TxtSoNgayToiHan = new System.Windows.Forms.TextBox();
            this._TxtNgayToiHanThanhToan = new System.Windows.Forms.DateTimePicker();
            this._CboKhaiThue = new System.Windows.Forms.ComboBox();
            this._Label18 = new System.Windows.Forms.Label();
            this._Label24 = new System.Windows.Forms.Label();
            this._TxtMaSoThue = new System.Windows.Forms.TextBox();
            this._Label17 = new System.Windows.Forms.Label();
            this._Label20 = new System.Windows.Forms.Label();
            this._AdvTaiKhoanThue = new ACCOUNTING.ADVAccount();
            this._Label16 = new System.Windows.Forms.Label();
            this._AdvNhaCungCap = new ACCOUNTING.ADVObjects();
            this._TxtThueSuat = new C1.Win.C1Input.C1NumericEdit();
            this._Label15 = new System.Windows.Forms.Label();
            this._Label14 = new System.Windows.Forms.Label();
            this._TxtSoSeri = new System.Windows.Forms.TextBox();
            this._Label8 = new System.Windows.Forms.Label();
            this._TxtNgayHoaDon = new System.Windows.Forms.DateTimePicker();
            this._Label12 = new System.Windows.Forms.Label();
            this._TxtSoHoaDon = new System.Windows.Forms.TextBox();
            this._CboLoaiHoaDon = new System.Windows.Forms.ComboBox();
            this._Label7 = new System.Windows.Forms.Label();
            this._CmdTimDonHang = new System.Windows.Forms.Button();
            this._Label4 = new System.Windows.Forms.Label();
            this._TxtNgayDathang = new System.Windows.Forms.DateTimePicker();
            this._Label6 = new System.Windows.Forms.Label();
            this._TxtSoDonHang = new System.Windows.Forms.TextBox();
            this._TxtDienGiai = new System.Windows.Forms.TextBox();
            this._Label9 = new System.Windows.Forms.Label();
            this._TxtNguoiGiao = new System.Windows.Forms.TextBox();
            this._Label3 = new System.Windows.Forms.Label();
            this._CboLoaiTien = new System.Windows.Forms.ComboBox();
            this._txtTyGia = new C1.Win.C1Input.C1NumericEdit();
            this._Label11 = new System.Windows.Forms.Label();
            this._Label10 = new System.Windows.Forms.Label();
            this._Label2 = new System.Windows.Forms.Label();
            this._AdvTaiKhoanCo = new ACCOUNTING.ADVAccount();
            this._Label13 = new System.Windows.Forms.Label();
            this._TxtNgayChungTu = new System.Windows.Forms.DateTimePicker();
            this._Label1 = new System.Windows.Forms.Label();
            this._TxtSoChungTu = new System.Windows.Forms.TextBox();
            this._Panel4 = new System.Windows.Forms.Panel();
            this._CKTheoDoiSeri = new System.Windows.Forms.CheckBox();
            this._CmdCopy = new System.Windows.Forms.Button();
            this._CmdDelRow = new System.Windows.Forms.Button();
            this._CmdAddRow = new System.Windows.Forms.Button();
            this._Panel5 = new System.Windows.Forms.Panel();
            this._LinkLabel1 = new System.Windows.Forms.LinkLabel();
            this._TxtTongThanhToanNT = new C1.Win.C1Input.C1NumericEdit();
            this._TxtTongThanhToan = new C1.Win.C1Input.C1NumericEdit();
            this._Label23 = new System.Windows.Forms.Label();
            this._TxtTienThueNT = new C1.Win.C1Input.C1NumericEdit();
            this._TxtTienHangNT = new C1.Win.C1Input.C1NumericEdit();
            this._TxtChietKhauNT = new C1.Win.C1Input.C1NumericEdit();
            this._TxtTienThue = new C1.Win.C1Input.C1NumericEdit();
            this._TxtTienHang = new C1.Win.C1Input.C1NumericEdit();
            this._TxtChietKhau = new C1.Win.C1Input.C1NumericEdit();
            this._Label22 = new System.Windows.Forms.Label();
            this._Label5 = new System.Windows.Forms.Label();
            this._C1DockingTab2 = new C1.Win.C1Command.C1DockingTab();
            this._C1DockingTabPage2 = new C1.Win.C1Command.C1DockingTabPage();
            this._VSList = new C1.Win.C1FlexGrid.C1FlexGrid();
            this._ToolStrip1.SuspendLayout();
            ((System.ComponentModel.ISupportInitialize)(this._C1DockingTab1)).BeginInit();
            this._C1DockingTab1.SuspendLayout();
            this._C1DockingTabPage1.SuspendLayout();
            ((System.ComponentModel.ISupportInitialize)(this._TxtThueSuat)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this._txtTyGia)).BeginInit();
            this._Panel4.SuspendLayout();
            this._Panel5.SuspendLayout();
            ((System.ComponentModel.ISupportInitialize)(this._TxtTongThanhToanNT)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this._TxtTongThanhToan)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this._TxtTienThueNT)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this._TxtTienHangNT)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this._TxtChietKhauNT)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this._TxtTienThue)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this._TxtTienHang)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this._TxtChietKhau)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this._C1DockingTab2)).BeginInit();
            this._C1DockingTab2.SuspendLayout();
            this._C1DockingTabPage2.SuspendLayout();
            ((System.ComponentModel.ISupportInitialize)(this._VSList)).BeginInit();
            this.SuspendLayout();
            // 
            // _ToolStrip1
            // 
            this._ToolStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
            this._CmdAdd,
            this._CmdEdit,
            this._ToolStripSeparator2,
            this._CmdSave,
            this._CmdUnsave,
            this._ToolStripSeparator1,
            this._CmdFind,
            this._CmdPrint,
            this._ToolStripButton1,
            this._CmdDel,
            this._ToolStripSeparator3,
            this._CmdExit,
            this._cmdHelp});
            this._ToolStrip1.Location = new System.Drawing.Point(0, 0);
            this._ToolStrip1.Name = "_ToolStrip1";
            this._ToolStrip1.Size = new System.Drawing.Size(895, 25);
            this._ToolStrip1.TabIndex = 0;
            this._ToolStrip1.Text = "ToolStrip1";
            // 
            // _CmdAdd
            // 
            this._CmdAdd.Image = ((System.Drawing.Image)(resources.GetObject("_CmdAdd.Image")));
            this._CmdAdd.ImageTransparentColor = System.Drawing.Color.White;
            this._CmdAdd.Name = "_CmdAdd";
            this._CmdAdd.Size = new System.Drawing.Size(82, 22);
            this._CmdAdd.Text = "&Thêm mới";
            this._CmdAdd.ToolTipText = "F8 Thêm mới";
            // 
            // _CmdEdit
            // 
            this._CmdEdit.Image = ((System.Drawing.Image)(resources.GetObject("_CmdEdit.Image")));
            this._CmdEdit.ImageTransparentColor = System.Drawing.Color.White;
            this._CmdEdit.Name = "_CmdEdit";
            this._CmdEdit.Size = new System.Drawing.Size(46, 22);
            this._CmdEdit.Text = "&Sửa";
            this._CmdEdit.ToolTipText = "F2 Sửa";
            // 
            // _ToolStripSeparator2
            // 
            this._ToolStripSeparator2.Name = "_ToolStripSeparator2";
            this._ToolStripSeparator2.Size = new System.Drawing.Size(6, 25);
            // 
            // _CmdSave
            // 
            this._CmdSave.Image = ((System.Drawing.Image)(resources.GetObject("_CmdSave.Image")));
            this._CmdSave.ImageTransparentColor = System.Drawing.Color.WhiteSmoke;
            this._CmdSave.Name = "_CmdSave";
            this._CmdSave.Size = new System.Drawing.Size(47, 22);
            this._CmdSave.Text = "&Lưu";
            this._CmdSave.ToolTipText = "F10 Lưu";
            // 
            // _CmdUnsave
            // 
            this._CmdUnsave.Image = ((System.Drawing.Image)(resources.GetObject("_CmdUnsave.Image")));
            this._CmdUnsave.ImageTransparentColor = System.Drawing.Color.White;
            this._CmdUnsave.Name = "_CmdUnsave";
            this._CmdUnsave.Size = new System.Drawing.Size(57, 22);
            this._CmdUnsave.Text = "&K.Lưu";
            this._CmdUnsave.ToolTipText = "F11 Không lưu";
            // 
            // _ToolStripSeparator1
            // 
            this._ToolStripSeparator1.Name = "_ToolStripSeparator1";
            this._ToolStripSeparator1.Size = new System.Drawing.Size(6, 25);
            // 
            // _CmdFind
            // 
            this._CmdFind.Image = ((System.Drawing.Image)(resources.GetObject("_CmdFind.Image")));
            this._CmdFind.ImageTransparentColor = System.Drawing.Color.White;
            this._CmdFind.Name = "_CmdFind";
            this._CmdFind.Size = new System.Drawing.Size(77, 22);
            this._CmdFind.Text = "Tìm kiếm";
            this._CmdFind.ToolTipText = "F3 Tìm kiếm";
            // 
            // _CmdPrint
            // 
            this._CmdPrint.Image = ((System.Drawing.Image)(resources.GetObject("_CmdPrint.Image")));
            this._CmdPrint.ImageTransparentColor = System.Drawing.Color.White;
            this._CmdPrint.Name = "_CmdPrint";
            this._CmdPrint.Size = new System.Drawing.Size(37, 22);
            this._CmdPrint.Text = "&In";
            this._CmdPrint.ToolTipText = "F12 In";
            // 
            // _ToolStripButton1
            // 
            this._ToolStripButton1.Name = "_ToolStripButton1";
            this._ToolStripButton1.Size = new System.Drawing.Size(6, 25);
            // 
            // _CmdDel
            // 
            this._CmdDel.Image = ((System.Drawing.Image)(resources.GetObject("_CmdDel.Image")));
            this._CmdDel.ImageTransparentColor = System.Drawing.Color.White;
            this._CmdDel.Name = "_CmdDel";
            this._CmdDel.Size = new System.Drawing.Size(47, 22);
            this._CmdDel.Text = "&Xóa";
            this._CmdDel.ToolTipText = "F9 Xóa";
            // 
            // _ToolStripSeparator3
            // 
            this._ToolStripSeparator3.Name = "_ToolStripSeparator3";
            this._ToolStripSeparator3.Size = new System.Drawing.Size(6, 25);
            // 
            // _CmdExit
            // 
            this._CmdExit.Alignment = System.Windows.Forms.ToolStripItemAlignment.Right;
            this._CmdExit.Image = ((System.Drawing.Image)(resources.GetObject("_CmdExit.Image")));
            this._CmdExit.ImageTransparentColor = System.Drawing.Color.White;
            this._CmdExit.Name = "_CmdExit";
            this._CmdExit.Size = new System.Drawing.Size(58, 22);
            this._CmdExit.Text = "Th&oát";
            // 
            // _cmdHelp
            // 
            this._cmdHelp.Alignment = System.Windows.Forms.ToolStripItemAlignment.Right;
            this._cmdHelp.Image = ((System.Drawing.Image)(resources.GetObject("_cmdHelp.Image")));
            this._cmdHelp.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None;
            this._cmdHelp.ImageTransparentColor = System.Drawing.Color.White;
            this._cmdHelp.Name = "_cmdHelp";
            this._cmdHelp.Size = new System.Drawing.Size(53, 22);
            this._cmdHelp.Text = "&Help";
            // 
            // _C1DockingTab1
            // 
            this._C1DockingTab1.Controls.Add(this._C1DockingTabPage1);
            this._C1DockingTab1.Dock = System.Windows.Forms.DockStyle.Top;
            this._C1DockingTab1.Location = new System.Drawing.Point(0, 25);
            this._C1DockingTab1.Name = "_C1DockingTab1";
            this._C1DockingTab1.Size = new System.Drawing.Size(895, 183);
            this._C1DockingTab1.TabIndex = 0;
            this._C1DockingTab1.TabsSpacing = 5;
            this._C1DockingTab1.TabStyle = C1.Win.C1Command.TabStyleEnum.Office2007;
            this._C1DockingTab1.VisualStyle = C1.Win.C1Command.VisualStyle.Office2007Blue;
            this._C1DockingTab1.VisualStyleBase = C1.Win.C1Command.VisualStyle.Office2007Blue;
            // 
            // _C1DockingTabPage1
            // 
            this._C1DockingTabPage1.Controls.Add(this._TxtSoNgayToiHan);
            this._C1DockingTabPage1.Controls.Add(this._TxtNgayToiHanThanhToan);
            this._C1DockingTabPage1.Controls.Add(this._CboKhaiThue);
            this._C1DockingTabPage1.Controls.Add(this._Label18);
            this._C1DockingTabPage1.Controls.Add(this._Label24);
            this._C1DockingTabPage1.Controls.Add(this._TxtMaSoThue);
            this._C1DockingTabPage1.Controls.Add(this._Label17);
            this._C1DockingTabPage1.Controls.Add(this._Label20);
            this._C1DockingTabPage1.Controls.Add(this._AdvTaiKhoanThue);
            this._C1DockingTabPage1.Controls.Add(this._Label16);
            this._C1DockingTabPage1.Controls.Add(this._AdvNhaCungCap);
            this._C1DockingTabPage1.Controls.Add(this._TxtThueSuat);
            this._C1DockingTabPage1.Controls.Add(this._Label15);
            this._C1DockingTabPage1.Controls.Add(this._Label14);
            this._C1DockingTabPage1.Controls.Add(this._TxtSoSeri);
            this._C1DockingTabPage1.Controls.Add(this._Label8);
            this._C1DockingTabPage1.Controls.Add(this._TxtNgayHoaDon);
            this._C1DockingTabPage1.Controls.Add(this._Label12);
            this._C1DockingTabPage1.Controls.Add(this._TxtSoHoaDon);
            this._C1DockingTabPage1.Controls.Add(this._CboLoaiHoaDon);
            this._C1DockingTabPage1.Controls.Add(this._Label7);
            this._C1DockingTabPage1.Controls.Add(this._CmdTimDonHang);
            this._C1DockingTabPage1.Controls.Add(this._Label4);
            this._C1DockingTabPage1.Controls.Add(this._TxtNgayDathang);
            this._C1DockingTabPage1.Controls.Add(this._Label6);
            this._C1DockingTabPage1.Controls.Add(this._TxtSoDonHang);
            this._C1DockingTabPage1.Controls.Add(this._TxtDienGiai);
            this._C1DockingTabPage1.Controls.Add(this._Label9);
            this._C1DockingTabPage1.Controls.Add(this._TxtNguoiGiao);
            this._C1DockingTabPage1.Controls.Add(this._Label3);
            this._C1DockingTabPage1.Controls.Add(this._CboLoaiTien);
            this._C1DockingTabPage1.Controls.Add(this._txtTyGia);
            this._C1DockingTabPage1.Controls.Add(this._Label11);
            this._C1DockingTabPage1.Controls.Add(this._Label10);
            this._C1DockingTabPage1.Controls.Add(this._Label2);
            this._C1DockingTabPage1.Controls.Add(this._AdvTaiKhoanCo);
            this._C1DockingTabPage1.Controls.Add(this._Label13);
            this._C1DockingTabPage1.Controls.Add(this._TxtNgayChungTu);
            this._C1DockingTabPage1.Controls.Add(this._Label1);
            this._C1DockingTabPage1.Controls.Add(this._TxtSoChungTu);
            this._C1DockingTabPage1.Location = new System.Drawing.Point(1, 24);
            this._C1DockingTabPage1.Name = "_C1DockingTabPage1";
            this._C1DockingTabPage1.Size = new System.Drawing.Size(893, 158);
            this._C1DockingTabPage1.TabIndex = 0;
            this._C1DockingTabPage1.Text = "Thông tin hóa đơn mua dịch vụ";
            // 
            // _TxtSoNgayToiHan
            // 
            this._TxtSoNgayToiHan.Location = new System.Drawing.Point(292, 82);
            this._TxtSoNgayToiHan.Name = "_TxtSoNgayToiHan";
            this._TxtSoNgayToiHan.Size = new System.Drawing.Size(28, 20);
            this._TxtSoNgayToiHan.TabIndex = 6;
            // 
            // _TxtNgayToiHanThanhToan
            // 
            this._TxtNgayToiHanThanhToan.Format = System.Windows.Forms.DateTimePickerFormat.Custom;
            this._TxtNgayToiHanThanhToan.Location = new System.Drawing.Point(321, 82);
            this._TxtNgayToiHanThanhToan.Name = "_TxtNgayToiHanThanhToan";
            this._TxtNgayToiHanThanhToan.Size = new System.Drawing.Size(82, 20);
            this._TxtNgayToiHanThanhToan.TabIndex = 7;
            // 
            // _CboKhaiThue
            // 
            this._CboKhaiThue.FormattingEnabled = true;
            this._CboKhaiThue.Location = new System.Drawing.Point(526, 13);
            this._CboKhaiThue.Name = "_CboKhaiThue";
            this._CboKhaiThue.Size = new System.Drawing.Size(356, 21);
            this._CboKhaiThue.TabIndex = 9;
            // 
            // _Label18
            // 
            this._Label18.AutoSize = true;
            this._Label18.BackColor = System.Drawing.Color.Transparent;
            this._Label18.Location = new System.Drawing.Point(441, 18);
            this._Label18.Name = "_Label18";
            this._Label18.Size = new System.Drawing.Size(52, 13);
            this._Label18.TabIndex = 168;
            this._Label18.Text = "Khai thuế";
            // 
            // _Label24
            // 
            this._Label24.AutoSize = true;
            this._Label24.BackColor = System.Drawing.Color.Transparent;
            this._Label24.Location = new System.Drawing.Point(209, 85);
            this._Label24.Name = "_Label24";
            this._Label24.Size = new System.Drawing.Size(81, 13);
            this._Label24.TabIndex = 164;
            this._Label24.Text = "Hạn thanh toá&n";
            // 
            // _TxtMaSoThue
            // 
            this._TxtMaSoThue.Location = new System.Drawing.Point(114, 82);
            this._TxtMaSoThue.MaxLength = 14;
            this._TxtMaSoThue.Name = "_TxtMaSoThue";
            this._TxtMaSoThue.Size = new System.Drawing.Size(80, 20);
            this._TxtMaSoThue.TabIndex = 5;
            // 
            // _Label17
            // 
            this._Label17.AutoEllipsis = true;
            this._Label17.AutoSize = true;
            this._Label17.BackColor = System.Drawing.Color.Transparent;
            this._Label17.Location = new System.Drawing.Point(22, 108);
            this._Label17.Name = "_Label17";
            this._Label17.Size = new System.Drawing.Size(58, 13);
            this._Label17.TabIndex = 163;
            this._Label17.Text = "Người giao";
            this._Label17.TextAlign = System.Drawing.ContentAlignment.TopRight;
            // 
            // _Label20
            // 
            this._Label20.AutoSize = true;
            this._Label20.BackColor = System.Drawing.Color.Transparent;
            this._Label20.Location = new System.Drawing.Point(441, 110);
            this._Label20.Name = "_Label20";
            this._Label20.Size = new System.Drawing.Size(79, 13);
            this._Label20.TabIndex = 162;
            this._Label20.Text = "Tài khoản thuế";
            // 
            // _AdvTaiKhoanThue
            // 
            this._AdvTaiKhoanThue.Conditions = "";
            this._AdvTaiKhoanThue.DefaultValue = "";
            this._AdvTaiKhoanThue.FieldNameFilter = "Left(SoTaiKhoan,3)";
            this._AdvTaiKhoanThue.KeyFilter = "133";
            this._AdvTaiKhoanThue.Location = new System.Drawing.Point(526, 107);
            this._AdvTaiKhoanThue.Margin = new System.Windows.Forms.Padding(0);
            this._AdvTaiKhoanThue.Name = "_AdvTaiKhoanThue";
            this._AdvTaiKhoanThue.OnlyDigit = false;
            this._AdvTaiKhoanThue.ReadOnly = false;
            this._AdvTaiKhoanThue.Size = new System.Drawing.Size(356, 20);
            this._AdvTaiKhoanThue.TabIndex = 16;
            this._AdvTaiKhoanThue.UpperText = true;
            this._AdvTaiKhoanThue.Value = "";
            this._AdvTaiKhoanThue.WithCode = 80;
            // 
            // _Label16
            // 
            this._Label16.AutoEllipsis = true;
            this._Label16.AutoSize = true;
            this._Label16.BackColor = System.Drawing.Color.Transparent;
            this._Label16.Location = new System.Drawing.Point(22, 62);
            this._Label16.Name = "_Label16";
            this._Label16.Size = new System.Drawing.Size(75, 13);
            this._Label16.TabIndex = 161;
            this._Label16.Text = "Nhà cung cấp";
            this._Label16.TextAlign = System.Drawing.ContentAlignment.TopRight;
            // 
            // _AdvNhaCungCap
            // 
            this._AdvNhaCungCap.Conditions = "";
            this._AdvNhaCungCap.LoaiDoiTuong = ACCOUNTING.LVY.Business.modGeneral.TypeObjects.NhaCungCap;
            this._AdvNhaCungCap.Location = new System.Drawing.Point(114, 59);
            this._AdvNhaCungCap.Name = "_AdvNhaCungCap";
            this._AdvNhaCungCap.ReadOnly = false;
            this._AdvNhaCungCap.Size = new System.Drawing.Size(290, 20);
            this._AdvNhaCungCap.TabIndex = 4;
            this._AdvNhaCungCap.UpperText = true;
            this._AdvNhaCungCap.Value = "";
            this._AdvNhaCungCap.WidthCode = 80;
            // 
            // _TxtThueSuat
            // 
            this._TxtThueSuat.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
            this._TxtThueSuat.DataType = typeof(short);
            this._TxtThueSuat.FormatType = C1.Win.C1Input.FormatTypeEnum.Integer;
            this._TxtThueSuat.Location = new System.Drawing.Point(792, 62);
            this._TxtThueSuat.Name = "_TxtThueSuat";
            this._TxtThueSuat.Padding = new System.Windows.Forms.Padding(1);
            this._TxtThueSuat.Size = new System.Drawing.Size(90, 20);
            this._TxtThueSuat.TabIndex = 14;
            this._TxtThueSuat.Tag = null;
            this._TxtThueSuat.VisibleButtons = C1.Win.C1Input.DropDownControlButtonFlags.DropDown;
            this._TxtThueSuat.VisualStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this._TxtThueSuat.VisualStyleBaseStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            // 
            // _Label15
            // 
            this._Label15.AutoSize = true;
            this._Label15.BackColor = System.Drawing.Color.Transparent;
            this._Label15.Location = new System.Drawing.Point(726, 64);
            this._Label15.Name = "_Label15";
            this._Label15.Size = new System.Drawing.Size(55, 13);
            this._Label15.TabIndex = 160;
            this._Label15.Text = "Thuế suất";
            this._Label15.TextAlign = System.Drawing.ContentAlignment.TopRight;
            // 
            // _Label14
            // 
            this._Label14.AutoSize = true;
            this._Label14.BackColor = System.Drawing.Color.Transparent;
            this._Label14.Location = new System.Drawing.Point(616, 41);
            this._Label14.Name = "_Label14";
            this._Label14.Size = new System.Drawing.Size(39, 13);
            this._Label14.TabIndex = 159;
            this._Label14.Text = "Số seri";
            // 
            // _TxtSoSeri
            // 
            this._TxtSoSeri.Location = new System.Drawing.Point(658, 37);
            this._TxtSoSeri.Name = "_TxtSoSeri";
            this._TxtSoSeri.Size = new System.Drawing.Size(90, 20);
            this._TxtSoSeri.TabIndex = 11;
            // 
            // _Label8
            // 
            this._Label8.AutoSize = true;
            this._Label8.BackColor = System.Drawing.Color.Transparent;
            this._Label8.Location = new System.Drawing.Point(754, 40);
            this._Label8.Name = "_Label8";
            this._Label8.Size = new System.Drawing.Size(32, 13);
            this._Label8.TabIndex = 158;
            this._Label8.Text = "Ngày";
            // 
            // _TxtNgayHoaDon
            // 
            this._TxtNgayHoaDon.Format = System.Windows.Forms.DateTimePickerFormat.Custom;
            this._TxtNgayHoaDon.Location = new System.Drawing.Point(792, 37);
            this._TxtNgayHoaDon.Name = "_TxtNgayHoaDon";
            this._TxtNgayHoaDon.Size = new System.Drawing.Size(90, 20);
            this._TxtNgayHoaDon.TabIndex = 12;
            // 
            // _Label12
            // 
            this._Label12.AutoSize = true;
            this._Label12.BackColor = System.Drawing.Color.Transparent;
            this._Label12.Location = new System.Drawing.Point(441, 41);
            this._Label12.Name = "_Label12";
            this._Label12.Size = new System.Drawing.Size(63, 13);
            this._Label12.TabIndex = 157;
            this._Label12.Text = "Số hóa đơn";
            // 
            // _TxtSoHoaDon
            // 
            this._TxtSoHoaDon.Location = new System.Drawing.Point(526, 38);
            this._TxtSoHoaDon.Name = "_TxtSoHoaDon";
            this._TxtSoHoaDon.Size = new System.Drawing.Size(90, 20);
            this._TxtSoHoaDon.TabIndex = 10;
            // 
            // _CboLoaiHoaDon
            // 
            this._CboLoaiHoaDon.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
            this._CboLoaiHoaDon.FormattingEnabled = true;
            this._CboLoaiHoaDon.Location = new System.Drawing.Point(526, 60);
            this._CboLoaiHoaDon.Name = "_CboLoaiHoaDon";
            this._CboLoaiHoaDon.Size = new System.Drawing.Size(194, 21);
            this._CboLoaiHoaDon.TabIndex = 13;
            // 
            // _Label7
            // 
            this._Label7.AutoSize = true;
            this._Label7.BackColor = System.Drawing.Color.Transparent;
            this._Label7.Location = new System.Drawing.Point(441, 64);
            this._Label7.Name = "_Label7";
            this._Label7.Size = new System.Drawing.Size(70, 13);
            this._Label7.TabIndex = 156;
            this._Label7.Text = "Loại hóa đơn";
            this._Label7.TextAlign = System.Drawing.ContentAlignment.TopRight;
            // 
            // _CmdTimDonHang
            // 
            this._CmdTimDonHang.Location = new System.Drawing.Point(1093, 12);
            this._CmdTimDonHang.Name = "_CmdTimDonHang";
            this._CmdTimDonHang.Size = new System.Drawing.Size(24, 22);
            this._CmdTimDonHang.TabIndex = 155;
            this._CmdTimDonHang.Text = "...";
            this._CmdTimDonHang.UseVisualStyleBackColor = true;
            // 
            // _Label4
            // 
            this._Label4.AutoSize = true;
            this._Label4.BackColor = System.Drawing.Color.Transparent;
            this._Label4.Location = new System.Drawing.Point(924, 42);
            this._Label4.Name = "_Label4";
            this._Label4.Size = new System.Drawing.Size(32, 13);
            this._Label4.TabIndex = 154;
            this._Label4.Text = "Ngày";
            // 
            // _TxtNgayDathang
            // 
            this._TxtNgayDathang.Enabled = false;
            this._TxtNgayDathang.Format = System.Windows.Forms.DateTimePickerFormat.Custom;
            this._TxtNgayDathang.Location = new System.Drawing.Point(972, 39);
            this._TxtNgayDathang.Name = "_TxtNgayDathang";
            this._TxtNgayDathang.Size = new System.Drawing.Size(104, 20);
            this._TxtNgayDathang.TabIndex = 153;
            // 
            // _Label6
            // 
            this._Label6.AutoSize = true;
            this._Label6.BackColor = System.Drawing.Color.Transparent;
            this._Label6.Location = new System.Drawing.Point(916, 16);
            this._Label6.Name = "_Label6";
            this._Label6.Size = new System.Drawing.Size(68, 13);
            this._Label6.TabIndex = 152;
            this._Label6.Text = "Đơn hàng số";
            // 
            // _TxtSoDonHang
            // 
            this._TxtSoDonHang.Location = new System.Drawing.Point(1008, 13);
            this._TxtSoDonHang.Name = "_TxtSoDonHang";
            this._TxtSoDonHang.ReadOnly = true;
            this._TxtSoDonHang.Size = new System.Drawing.Size(85, 20);
            this._TxtSoDonHang.TabIndex = 151;
            // 
            // _TxtDienGiai
            // 
            this._TxtDienGiai.Location = new System.Drawing.Point(114, 128);
            this._TxtDienGiai.Name = "_TxtDienGiai";
            this._TxtDienGiai.Size = new System.Drawing.Size(768, 20);
            this._TxtDienGiai.TabIndex = 17;
            // 
            // _Label9
            // 
            this._Label9.AutoEllipsis = true;
            this._Label9.AutoSize = true;
            this._Label9.BackColor = System.Drawing.Color.Transparent;
            this._Label9.Location = new System.Drawing.Point(22, 131);
            this._Label9.Name = "_Label9";
            this._Label9.Size = new System.Drawing.Size(48, 13);
            this._Label9.TabIndex = 150;
            this._Label9.Text = "Diễn giải";
            this._Label9.TextAlign = System.Drawing.ContentAlignment.TopRight;
            // 
            // _TxtNguoiGiao
            // 
            this._TxtNguoiGiao.Location = new System.Drawing.Point(114, 105);
            this._TxtNguoiGiao.Name = "_TxtNguoiGiao";
            this._TxtNguoiGiao.Size = new System.Drawing.Size(290, 20);
            this._TxtNguoiGiao.TabIndex = 8;
            // 
            // _Label3
            // 
            this._Label3.AutoEllipsis = true;
            this._Label3.AutoSize = true;
            this._Label3.BackColor = System.Drawing.Color.Transparent;
            this._Label3.Location = new System.Drawing.Point(22, 85);
            this._Label3.Name = "_Label3";
            this._Label3.Size = new System.Drawing.Size(60, 13);
            this._Label3.TabIndex = 149;
            this._Label3.Text = "Mã số thuế";
            this._Label3.TextAlign = System.Drawing.ContentAlignment.TopRight;
            // 
            // _CboLoaiTien
            // 
            this._CboLoaiTien.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
            this._CboLoaiTien.FormattingEnabled = true;
            this._CboLoaiTien.Location = new System.Drawing.Point(114, 36);
            this._CboLoaiTien.Name = "_CboLoaiTien";
            this._CboLoaiTien.Size = new System.Drawing.Size(108, 21);
            this._CboLoaiTien.TabIndex = 2;
            // 
            // _txtTyGia
            // 
            this._txtTyGia.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
            this._txtTyGia.DataType = typeof(double);
            this._txtTyGia.FormatType = C1.Win.C1Input.FormatTypeEnum.Currency;
            this._txtTyGia.Location = new System.Drawing.Point(300, 36);
            this._txtTyGia.Name = "_txtTyGia";
            this._txtTyGia.Padding = new System.Windows.Forms.Padding(1);
            this._txtTyGia.Size = new System.Drawing.Size(104, 20);
            this._txtTyGia.TabIndex = 3;
            this._txtTyGia.Tag = null;
            this._txtTyGia.VisibleButtons = C1.Win.C1Input.DropDownControlButtonFlags.DropDown;
            this._txtTyGia.VisualStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this._txtTyGia.VisualStyleBaseStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            // 
            // _Label11
            // 
            this._Label11.AutoSize = true;
            this._Label11.BackColor = System.Drawing.Color.Transparent;
            this._Label11.Location = new System.Drawing.Point(22, 39);
            this._Label11.Name = "_Label11";
            this._Label11.Size = new System.Drawing.Size(47, 13);
            this._Label11.TabIndex = 148;
            this._Label11.Text = "Loại tiền";
            this._Label11.TextAlign = System.Drawing.ContentAlignment.TopRight;
            // 
            // _Label10
            // 
            this._Label10.AutoSize = true;
            this._Label10.BackColor = System.Drawing.Color.Transparent;
            this._Label10.Location = new System.Drawing.Point(248, 39);
            this._Label10.Name = "_Label10";
            this._Label10.Size = new System.Drawing.Size(36, 13);
            this._Label10.TabIndex = 147;
            this._Label10.Text = "Tỷ giá";
            this._Label10.TextAlign = System.Drawing.ContentAlignment.TopRight;
            // 
            // _Label2
            // 
            this._Label2.AutoSize = true;
            this._Label2.BackColor = System.Drawing.Color.Transparent;
            this._Label2.Location = new System.Drawing.Point(441, 88);
            this._Label2.Name = "_Label2";
            this._Label2.Size = new System.Drawing.Size(70, 13);
            this._Label2.TabIndex = 146;
            this._Label2.Text = "Tài khoản có";
            // 
            // _AdvTaiKhoanCo
            // 
            this._AdvTaiKhoanCo.Conditions = "";
            this._AdvTaiKhoanCo.DefaultValue = "";
            this._AdvTaiKhoanCo.FieldNameFilter = "Left(SoTaiKhoan,3)";
            this._AdvTaiKhoanCo.KeyFilter = "111|331";
            this._AdvTaiKhoanCo.Location = new System.Drawing.Point(526, 84);
            this._AdvTaiKhoanCo.Margin = new System.Windows.Forms.Padding(0);
            this._AdvTaiKhoanCo.Name = "_AdvTaiKhoanCo";
            this._AdvTaiKhoanCo.OnlyDigit = false;
            this._AdvTaiKhoanCo.ReadOnly = false;
            this._AdvTaiKhoanCo.Size = new System.Drawing.Size(356, 20);
            this._AdvTaiKhoanCo.TabIndex = 15;
            this._AdvTaiKhoanCo.UpperText = true;
            this._AdvTaiKhoanCo.Value = "";
            this._AdvTaiKhoanCo.WithCode = 80;
            // 
            // _Label13
            // 
            this._Label13.AutoSize = true;
            this._Label13.BackColor = System.Drawing.Color.Transparent;
            this._Label13.Location = new System.Drawing.Point(252, 16);
            this._Label13.Name = "_Label13";
            this._Label13.Size = new System.Drawing.Size(32, 13);
            this._Label13.TabIndex = 145;
            this._Label13.Text = "Ngày";
            // 
            // _TxtNgayChungTu
            // 
            this._TxtNgayChungTu.Format = System.Windows.Forms.DateTimePickerFormat.Custom;
            this._TxtNgayChungTu.Location = new System.Drawing.Point(300, 13);
            this._TxtNgayChungTu.Name = "_TxtNgayChungTu";
            this._TxtNgayChungTu.Size = new System.Drawing.Size(104, 20);
            this._TxtNgayChungTu.TabIndex = 1;
            // 
            // _Label1
            // 
            this._Label1.AutoSize = true;
            this._Label1.BackColor = System.Drawing.Color.Transparent;
            this._Label1.Location = new System.Drawing.Point(22, 16);
            this._Label1.Name = "_Label1";
            this._Label1.Size = new System.Drawing.Size(65, 13);
            this._Label1.TabIndex = 144;
            this._Label1.Text = "Số chứng từ";
            // 
            // _TxtSoChungTu
            // 
            this._TxtSoChungTu.Location = new System.Drawing.Point(114, 13);
            this._TxtSoChungTu.Name = "_TxtSoChungTu";
            this._TxtSoChungTu.Size = new System.Drawing.Size(108, 20);
            this._TxtSoChungTu.TabIndex = 0;
            // 
            // _Panel4
            // 
            this._Panel4.Controls.Add(this._CKTheoDoiSeri);
            this._Panel4.Controls.Add(this._CmdCopy);
            this._Panel4.Controls.Add(this._CmdDelRow);
            this._Panel4.Controls.Add(this._CmdAddRow);
            this._Panel4.Controls.Add(this._Panel5);
            this._Panel4.Dock = System.Windows.Forms.DockStyle.Bottom;
            this._Panel4.Location = new System.Drawing.Point(0, 481);
            this._Panel4.Name = "_Panel4";
            this._Panel4.Size = new System.Drawing.Size(895, 88);
            this._Panel4.TabIndex = 1;
            // 
            // _CKTheoDoiSeri
            // 
            this._CKTheoDoiSeri.AutoSize = true;
            this._CKTheoDoiSeri.Location = new System.Drawing.Point(4, 90);
            this._CKTheoDoiSeri.Name = "_CKTheoDoiSeri";
            this._CKTheoDoiSeri.Size = new System.Drawing.Size(101, 17);
            this._CKTheoDoiSeri.TabIndex = 125;
            this._CKTheoDoiSeri.Text = "Theo dõi số seri";
            this._CKTheoDoiSeri.UseVisualStyleBackColor = true;
            // 
            // _CmdCopy
            // 
            this._CmdCopy.Image = ((System.Drawing.Image)(resources.GetObject("_CmdCopy.Image")));
            this._CmdCopy.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
            this._CmdCopy.Location = new System.Drawing.Point(185, 3);
            this._CmdCopy.Name = "_CmdCopy";
            this._CmdCopy.Size = new System.Drawing.Size(91, 24);
            this._CmdCopy.TabIndex = 2;
            this._CmdCopy.Text = "&3.Copy dòng";
            this._CmdCopy.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageBeforeText;
            this._CmdCopy.UseVisualStyleBackColor = true;
            this._CmdCopy.Visible = false;
            // 
            // _CmdDelRow
            // 
            this._CmdDelRow.Image = ((System.Drawing.Image)(resources.GetObject("_CmdDelRow.Image")));
            this._CmdDelRow.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
            this._CmdDelRow.Location = new System.Drawing.Point(98, 3);
            this._CmdDelRow.Name = "_CmdDelRow";
            this._CmdDelRow.Size = new System.Drawing.Size(85, 24);
            this._CmdDelRow.TabIndex = 1;
            this._CmdDelRow.Text = "&2.Xóa dòng";
            this._CmdDelRow.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageBeforeText;
            this._CmdDelRow.UseVisualStyleBackColor = true;
            // 
            // _CmdAddRow
            // 
            this._CmdAddRow.Image = ((System.Drawing.Image)(resources.GetObject("_CmdAddRow.Image")));
            this._CmdAddRow.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
            this._CmdAddRow.Location = new System.Drawing.Point(3, 3);
            this._CmdAddRow.Name = "_CmdAddRow";
            this._CmdAddRow.Size = new System.Drawing.Size(93, 24);
            this._CmdAddRow.TabIndex = 0;
            this._CmdAddRow.Text = "&1.Thêm dòng";
            this._CmdAddRow.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageBeforeText;
            this._CmdAddRow.UseVisualStyleBackColor = true;
            // 
            // _Panel5
            // 
            this._Panel5.Controls.Add(this._LinkLabel1);
            this._Panel5.Controls.Add(this._TxtTongThanhToanNT);
            this._Panel5.Controls.Add(this._TxtTongThanhToan);
            this._Panel5.Controls.Add(this._Label23);
            this._Panel5.Controls.Add(this._TxtTienThueNT);
            this._Panel5.Controls.Add(this._TxtTienHangNT);
            this._Panel5.Controls.Add(this._TxtChietKhauNT);
            this._Panel5.Controls.Add(this._TxtTienThue);
            this._Panel5.Controls.Add(this._TxtTienHang);
            this._Panel5.Controls.Add(this._TxtChietKhau);
            this._Panel5.Controls.Add(this._Label22);
            this._Panel5.Controls.Add(this._Label5);
            this._Panel5.Dock = System.Windows.Forms.DockStyle.Right;
            this._Panel5.Location = new System.Drawing.Point(588, 0);
            this._Panel5.Name = "_Panel5";
            this._Panel5.Size = new System.Drawing.Size(307, 88);
            this._Panel5.TabIndex = 0;
            // 
            // _LinkLabel1
            // 
            this._LinkLabel1.AutoSize = true;
            this._LinkLabel1.BackColor = System.Drawing.Color.Transparent;
            this._LinkLabel1.Location = new System.Drawing.Point(5, 26);
            this._LinkLabel1.Name = "_LinkLabel1";
            this._LinkLabel1.Size = new System.Drawing.Size(58, 13);
            this._LinkLabel1.TabIndex = 138;
            this._LinkLabel1.TabStop = true;
            this._LinkLabel1.Text = "Chiết khấu";
            // 
            // _TxtTongThanhToanNT
            // 
            this._TxtTongThanhToanNT.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
            this._TxtTongThanhToanNT.DataType = typeof(double);
            this._TxtTongThanhToanNT.FormatType = C1.Win.C1Input.FormatTypeEnum.Currency;
            this._TxtTongThanhToanNT.Location = new System.Drawing.Point(89, 65);
            this._TxtTongThanhToanNT.Name = "_TxtTongThanhToanNT";
            this._TxtTongThanhToanNT.Padding = new System.Windows.Forms.Padding(1);
            this._TxtTongThanhToanNT.ReadOnly = true;
            this._TxtTongThanhToanNT.Size = new System.Drawing.Size(105, 20);
            this._TxtTongThanhToanNT.TabIndex = 6;
            this._TxtTongThanhToanNT.Tag = null;
            this._TxtTongThanhToanNT.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
            this._TxtTongThanhToanNT.VisibleButtons = C1.Win.C1Input.DropDownControlButtonFlags.None;
            this._TxtTongThanhToanNT.VisualStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this._TxtTongThanhToanNT.VisualStyleBaseStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            // 
            // _TxtTongThanhToan
            // 
            this._TxtTongThanhToan.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
            this._TxtTongThanhToan.DataType = typeof(double);
            this._TxtTongThanhToan.FormatType = C1.Win.C1Input.FormatTypeEnum.Currency;
            this._TxtTongThanhToan.Location = new System.Drawing.Point(197, 65);
            this._TxtTongThanhToan.Name = "_TxtTongThanhToan";
            this._TxtTongThanhToan.Padding = new System.Windows.Forms.Padding(1);
            this._TxtTongThanhToan.ReadOnly = true;
            this._TxtTongThanhToan.Size = new System.Drawing.Size(105, 20);
            this._TxtTongThanhToan.TabIndex = 7;
            this._TxtTongThanhToan.Tag = null;
            this._TxtTongThanhToan.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
            this._TxtTongThanhToan.VisibleButtons = C1.Win.C1Input.DropDownControlButtonFlags.None;
            this._TxtTongThanhToan.VisualStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this._TxtTongThanhToan.VisualStyleBaseStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            // 
            // _Label23
            // 
            this._Label23.AutoSize = true;
            this._Label23.BackColor = System.Drawing.Color.Transparent;
            this._Label23.Location = new System.Drawing.Point(4, 68);
            this._Label23.Name = "_Label23";
            this._Label23.Size = new System.Drawing.Size(86, 13);
            this._Label23.TabIndex = 135;
            this._Label23.Text = "Tổng thanh toán";
            // 
            // _TxtTienThueNT
            // 
            this._TxtTienThueNT.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
            this._TxtTienThueNT.DataType = typeof(double);
            this._TxtTienThueNT.FormatType = C1.Win.C1Input.FormatTypeEnum.Currency;
            this._TxtTienThueNT.Location = new System.Drawing.Point(89, 44);
            this._TxtTienThueNT.Name = "_TxtTienThueNT";
            this._TxtTienThueNT.Padding = new System.Windows.Forms.Padding(1);
            this._TxtTienThueNT.ReadOnly = true;
            this._TxtTienThueNT.Size = new System.Drawing.Size(105, 20);
            this._TxtTienThueNT.TabIndex = 4;
            this._TxtTienThueNT.Tag = null;
            this._TxtTienThueNT.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
            this._TxtTienThueNT.VisibleButtons = C1.Win.C1Input.DropDownControlButtonFlags.None;
            this._TxtTienThueNT.VisualStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this._TxtTienThueNT.VisualStyleBaseStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            // 
            // _TxtTienHangNT
            // 
            this._TxtTienHangNT.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
            this._TxtTienHangNT.DataType = typeof(double);
            this._TxtTienHangNT.FormatType = C1.Win.C1Input.FormatTypeEnum.Currency;
            this._TxtTienHangNT.Location = new System.Drawing.Point(89, 2);
            this._TxtTienHangNT.Name = "_TxtTienHangNT";
            this._TxtTienHangNT.Padding = new System.Windows.Forms.Padding(1);
            this._TxtTienHangNT.ReadOnly = true;
            this._TxtTienHangNT.Size = new System.Drawing.Size(105, 20);
            this._TxtTienHangNT.TabIndex = 0;
            this._TxtTienHangNT.Tag = null;
            this._TxtTienHangNT.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
            this._TxtTienHangNT.VisibleButtons = C1.Win.C1Input.DropDownControlButtonFlags.None;
            this._TxtTienHangNT.VisualStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this._TxtTienHangNT.VisualStyleBaseStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            // 
            // _TxtChietKhauNT
            // 
            this._TxtChietKhauNT.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
            this._TxtChietKhauNT.DataType = typeof(double);
            this._TxtChietKhauNT.FormatType = C1.Win.C1Input.FormatTypeEnum.Currency;
            this._TxtChietKhauNT.Location = new System.Drawing.Point(89, 23);
            this._TxtChietKhauNT.Name = "_TxtChietKhauNT";
            this._TxtChietKhauNT.Padding = new System.Windows.Forms.Padding(1);
            this._TxtChietKhauNT.ReadOnly = true;
            this._TxtChietKhauNT.Size = new System.Drawing.Size(105, 20);
            this._TxtChietKhauNT.TabIndex = 2;
            this._TxtChietKhauNT.Tag = null;
            this._TxtChietKhauNT.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
            this._TxtChietKhauNT.VisibleButtons = C1.Win.C1Input.DropDownControlButtonFlags.None;
            this._TxtChietKhauNT.VisualStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this._TxtChietKhauNT.VisualStyleBaseStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            // 
            // _TxtTienThue
            // 
            this._TxtTienThue.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
            this._TxtTienThue.DataType = typeof(double);
            this._TxtTienThue.FormatType = C1.Win.C1Input.FormatTypeEnum.Currency;
            this._TxtTienThue.Location = new System.Drawing.Point(197, 44);
            this._TxtTienThue.Name = "_TxtTienThue";
            this._TxtTienThue.Padding = new System.Windows.Forms.Padding(1);
            this._TxtTienThue.ReadOnly = true;
            this._TxtTienThue.Size = new System.Drawing.Size(105, 20);
            this._TxtTienThue.TabIndex = 5;
            this._TxtTienThue.Tag = null;
            this._TxtTienThue.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
            this._TxtTienThue.VisibleButtons = C1.Win.C1Input.DropDownControlButtonFlags.None;
            this._TxtTienThue.VisualStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this._TxtTienThue.VisualStyleBaseStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            // 
            // _TxtTienHang
            // 
            this._TxtTienHang.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
            this._TxtTienHang.DataType = typeof(double);
            this._TxtTienHang.FormatType = C1.Win.C1Input.FormatTypeEnum.Currency;
            this._TxtTienHang.Location = new System.Drawing.Point(197, 2);
            this._TxtTienHang.Name = "_TxtTienHang";
            this._TxtTienHang.Padding = new System.Windows.Forms.Padding(1);
            this._TxtTienHang.ReadOnly = true;
            this._TxtTienHang.Size = new System.Drawing.Size(105, 20);
            this._TxtTienHang.TabIndex = 1;
            this._TxtTienHang.Tag = null;
            this._TxtTienHang.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
            this._TxtTienHang.VisibleButtons = C1.Win.C1Input.DropDownControlButtonFlags.None;
            this._TxtTienHang.VisualStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this._TxtTienHang.VisualStyleBaseStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            // 
            // _TxtChietKhau
            // 
            this._TxtChietKhau.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
            this._TxtChietKhau.DataType = typeof(double);
            this._TxtChietKhau.FormatType = C1.Win.C1Input.FormatTypeEnum.Currency;
            this._TxtChietKhau.Location = new System.Drawing.Point(197, 23);
            this._TxtChietKhau.Name = "_TxtChietKhau";
            this._TxtChietKhau.Padding = new System.Windows.Forms.Padding(1);
            this._TxtChietKhau.ReadOnly = true;
            this._TxtChietKhau.Size = new System.Drawing.Size(105, 20);
            this._TxtChietKhau.TabIndex = 3;
            this._TxtChietKhau.Tag = null;
            this._TxtChietKhau.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
            this._TxtChietKhau.VisibleButtons = C1.Win.C1Input.DropDownControlButtonFlags.None;
            this._TxtChietKhau.VisualStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this._TxtChietKhau.VisualStyleBaseStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            // 
            // _Label22
            // 
            this._Label22.AutoSize = true;
            this._Label22.BackColor = System.Drawing.Color.Transparent;
            this._Label22.Location = new System.Drawing.Point(4, 47);
            this._Label22.Name = "_Label22";
            this._Label22.Size = new System.Drawing.Size(52, 13);
            this._Label22.TabIndex = 117;
            this._Label22.Text = "Tiền thuế";
            // 
            // _Label5
            // 
            this._Label5.AutoSize = true;
            this._Label5.BackColor = System.Drawing.Color.Transparent;
            this._Label5.Location = new System.Drawing.Point(4, 6);
            this._Label5.Name = "_Label5";
            this._Label5.Size = new System.Drawing.Size(55, 13);
            this._Label5.TabIndex = 115;
            this._Label5.Text = "Tiền hàng";
            // 
            // _C1DockingTab2
            // 
            this._C1DockingTab2.Controls.Add(this._C1DockingTabPage2);
            this._C1DockingTab2.Dock = System.Windows.Forms.DockStyle.Fill;
            this._C1DockingTab2.Location = new System.Drawing.Point(0, 208);
            this._C1DockingTab2.Name = "_C1DockingTab2";
            this._C1DockingTab2.Size = new System.Drawing.Size(895, 273);
            this._C1DockingTab2.TabIndex = 2;
            this._C1DockingTab2.TabsSpacing = 5;
            this._C1DockingTab2.TabStyle = C1.Win.C1Command.TabStyleEnum.Office2007;
            this._C1DockingTab2.VisualStyle = C1.Win.C1Command.VisualStyle.Custom;
            this._C1DockingTab2.VisualStyleBase = C1.Win.C1Command.VisualStyle.Office2007Blue;
            // 
            // _C1DockingTabPage2
            // 
            this._C1DockingTabPage2.Controls.Add(this._VSList);
            this._C1DockingTabPage2.Location = new System.Drawing.Point(1, 24);
            this._C1DockingTabPage2.Name = "_C1DockingTabPage2";
            this._C1DockingTabPage2.Size = new System.Drawing.Size(893, 248);
            this._C1DockingTabPage2.TabIndex = 0;
            this._C1DockingTabPage2.Text = "Chi tiết dịch vụ";
            // 
            // _VSList
            // 
            this._VSList.BorderStyle = C1.Win.C1FlexGrid.Util.BaseControls.BorderStyleEnum.Light3D;
            this._VSList.ColumnInfo = resources.GetString("_VSList.ColumnInfo");
            this._VSList.Dock = System.Windows.Forms.DockStyle.Fill;
            this._VSList.ExtendLastCol = true;
            this._VSList.KeyActionEnter = C1.Win.C1FlexGrid.KeyActionEnum.MoveAcross;
            this._VSList.Location = new System.Drawing.Point(0, 0);
            this._VSList.Margin = new System.Windows.Forms.Padding(0);
            this._VSList.Name = "_VSList";
            this._VSList.Rows.Count = 1;
            this._VSList.Rows.DefaultSize = 17;
            this._VSList.Rows.MaxSize = 20;
            this._VSList.Rows.MinSize = 20;
            this._VSList.Size = new System.Drawing.Size(893, 248);
            this._VSList.StyleInfo = resources.GetString("_VSList.StyleInfo");
            this._VSList.TabIndex = 0;
            this._VSList.VisualStyle = C1.Win.C1FlexGrid.VisualStyle.Office2007Blue;
            // 
            // Frm_HoaDonMuaDichVu
            // 
            this.ClientSize = new System.Drawing.Size(895, 569);
            this.ControlBox = false;
            this.Controls.Add(this._C1DockingTab2);
            this.Controls.Add(this._Panel4);
            this.Controls.Add(this._C1DockingTab1);
            this.Controls.Add(this._ToolStrip1);
            this.KeyPreview = true;
            this.MaximizeBox = false;
            this.MinimizeBox = false;
            this.Name = "Frm_HoaDonMuaDichVu";
            this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
            this.Tag = "MH-0013";
            this.Text = "HOA DON MUA DICH VU";
            this._ToolStrip1.ResumeLayout(false);
            this._ToolStrip1.PerformLayout();
            ((System.ComponentModel.ISupportInitialize)(this._C1DockingTab1)).EndInit();
            this._C1DockingTab1.ResumeLayout(false);
            this._C1DockingTabPage1.ResumeLayout(false);
            this._C1DockingTabPage1.PerformLayout();
            ((System.ComponentModel.ISupportInitialize)(this._TxtThueSuat)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this._txtTyGia)).EndInit();
            this._Panel4.ResumeLayout(false);
            this._Panel4.PerformLayout();
            this._Panel5.ResumeLayout(false);
            this._Panel5.PerformLayout();
            ((System.ComponentModel.ISupportInitialize)(this._TxtTongThanhToanNT)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this._TxtTongThanhToan)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this._TxtTienThueNT)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this._TxtTienHangNT)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this._TxtChietKhauNT)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this._TxtTienThue)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this._TxtTienHang)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this._TxtChietKhau)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this._C1DockingTab2)).EndInit();
            this._C1DockingTab2.ResumeLayout(false);
            this._C1DockingTabPage2.ResumeLayout(false);
            ((System.ComponentModel.ISupportInitialize)(this._VSList)).EndInit();
            this.ResumeLayout(false);
            this.PerformLayout();

        }

        private void LinkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            MyProject.Forms.Frm_PhanBoChietKhau.objFrmCall = this;
            MyProject.Forms.Frm_PhanBoChietKhau.ShowDialog();
        }

        public void LoadDetailsDichVu(string strKhoa)
        {
            DataTable detailDichVu = this.objNK.GetDetailDichVu(strKhoa);
            int num = 0;
            C1.Win.C1FlexGrid.C1FlexGrid vSList = this.VSList;
            vSList.Rows.Count = 1;
            int num2 = detailDichVu.Rows.Count - 1;
            for (num = 0; num <= num2; num++)
            {
                vSList.AddItem("");
                vSList[vSList.Rows.Count - 1, 0] = RuntimeHelpers.GetObjectValue(detailDichVu.Rows[num]["Khoa"]);
                vSList[vSList.Rows.Count - 1, 1] = RuntimeHelpers.GetObjectValue(detailDichVu.Rows[num]["KhoaTaiKhoan"]);
                vSList[vSList.Rows.Count - 1, 2] = RuntimeHelpers.GetObjectValue(detailDichVu.Rows[num]["SoTaiKhoan"]);
                vSList[vSList.Rows.Count - 1, 3] = RuntimeHelpers.GetObjectValue(detailDichVu.Rows[num]["TenDichVu"]);
                //vSList[vSList.Rows.Count - 1, 4] = RuntimeHelpers.GetObjectValue(detailDichVu.Rows[num]["KhoaDichVu"]);
                //vSList[vSList.Rows.Count - 1, 5] = RuntimeHelpers.GetObjectValue(detailDichVu.Rows[num]["MaDichVu"]);
                //vSList[vSList.Rows.Count - 1, 6] = RuntimeHelpers.GetObjectValue(detailDichVu.Rows[num]["SoLuong"]);
                //vSList[vSList.Rows.Count - 1, 7] = RuntimeHelpers.GetObjectValue(detailDichVu.Rows[num]["DonGiaNT"]);
                //vSList[vSList.Rows.Count - 1, 8] = RuntimeHelpers.GetObjectValue(detailDichVu.Rows[num]["TienBanNT"]);
                //vSList[vSList.Rows.Count - 1, 9] = RuntimeHelpers.GetObjectValue(detailDichVu.Rows[num]["TyLeChietKhau"]);
                //vSList[vSList.Rows.Count - 1, 10] = RuntimeHelpers.GetObjectValue(detailDichVu.Rows[num]["TienChietKhauNT"]);
                //vSList[vSList.Rows.Count - 1, 11] = RuntimeHelpers.GetObjectValue(detailDichVu.Rows[num]["TyLeThue"]);
                //vSList[vSList.Rows.Count - 1, 12] = RuntimeHelpers.GetObjectValue(detailDichVu.Rows[num]["TienThueNT"]);
            }
            vSList = null;
        }

        public bool SaveDVDetailsTemp()
        {
            double num2 = 0.0;
            num2 = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.txtTyGia.Value), 0, modGeneral.TypeOfValue.Nothing));
            clsNhapKhoChiTietDichVu objNKDV = this.objNKDV;
            int num3 = this.VSList.Rows.Count - 1;
            for (int i = 1; i <= num3; i++)
            {
                if (LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSList[i, 1]), "", modGeneral.TypeOfValue.Nothing).ToString().Trim() != "")
                {
                    if (LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSList[i, 0]), "", modGeneral.TypeOfValue.Nothing).ToString().Trim() == "")
                    {
                        this.VSList[i, 0] = modGeneral.CreatKey("ST_XuatKhoChiTiet", 15, "");
                    }
                    objNKDV.Khoa = this.VSList[i, 0].ToString().Trim();
                    objNKDV.KhoaPhieuNhap = this.cFrmKhoa;
                    objNKDV.KhoaDichVu = LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSList[i, 4]), "", modGeneral.TypeOfValue.Nothing).ToString().Trim();
                    objNKDV.MaDichVu = LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSList[i, 5]), "", modGeneral.TypeOfValue.Nothing).ToString().Trim();
                    objNKDV.TenDichVu = LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSList[i, 3]), "", modGeneral.TypeOfValue.Nothing).ToString().Trim();
                    objNKDV.SoLuong = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSList[i, 6]), 0, modGeneral.TypeOfValue.Nothing));
                    objNKDV.DonGiaNT = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSList[i, 7]), 0, modGeneral.TypeOfValue.Nothing));
                    objNKDV.DonGia = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSList[i, 7]), 0, modGeneral.TypeOfValue.Nothing)) * num2;
                    objNKDV.TienBanNT = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSList[i, 8]), 0, modGeneral.TypeOfValue.Nothing));
                    objNKDV.TienBan = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSList[i, 8]), 0, modGeneral.TypeOfValue.Nothing)) * num2;
                    objNKDV.TyLeChietKhau = Conversions.ToInteger(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSList[i, 9]), 0, modGeneral.TypeOfValue.Nothing));
                    objNKDV.TienChietKhauNT = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSList[i, 10]), 0, modGeneral.TypeOfValue.Nothing));
                    objNKDV.TienChietKhau = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSList[i, 10]), 0, modGeneral.TypeOfValue.Nothing)) * num2;
                    objNKDV.TyLeThue = Conversions.ToInteger(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSList[i, 11]), 0, modGeneral.TypeOfValue.Nothing));
                    objNKDV.TienThueNT = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSList[i, 12]), 0, modGeneral.TypeOfValue.Nothing));
                    objNKDV.TienThue = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSList[i, 12]), 0, modGeneral.TypeOfValue.Nothing)) * num2;
                    objNKDV.KhoaTKchiPhi = this.VSList[i, 1].ToString().Trim();
                    if (!objNKDV.Save())
                    {
                        return false;
                    }
                }
            }
            objNKDV = null;
            return true;
        }

        public void ShowData(string strKhoa)
        {
            if (this.objNK.Load(strKhoa))
            {
                clsNhapKho objNK = this.objNK;
                this.cFrmKhoa = objNK.Khoa;
                this.TxtSoDonHang.Tag = objNK.KhoaDonHang;
                this.TxtNgayDathang.Text = LVYModule.Char2Date(objNK.NgayDonHang);
                this.TxtSoDonHang.Text = objNK.SoDonHang;
                this.TxtSoChungTu.Text = objNK.SoChungTu;
                this.TxtNgayChungTu.Text = LVYModule.Char2Date(objNK.NgayChungTu);
                this.CboLoaiTien.SelectedValue = objNK.LoaiTien.ToString().Trim();
                this.txtTyGia.Value = objNK.TyGia;
                this.AdvNhaCungCap.Value = objNK.KhoaDoiTuong;
                this.TxtNguoiGiao.Text = objNK.NguoiGiao;
                this.CboLoaiHoaDon.SelectedValue = objNK.KhoaLoaiHoaDon;
                this.TxtSoHoaDon.Text = objNK.SoHoaDon;
                this.TxtNgayHoaDon.Text = LVYModule.Char2Date(objNK.NgayHoaDon);
                this.TxtSoSeri.Text = objNK.SoSeri;
                this.TxtThueSuat.Value = objNK.ThueSuat;
                this.AdvTaiKhoanCo.Value = objNK.KhoaTKThanhToan;
                this.AdvTaiKhoanThue.Value = objNK.KhoaTKNoThueVAT;
                this.TxtTienHangNT.Value = objNK.TienHangNT;
                this.TxtTienHang.Value = objNK.TienHang;
                this.TxtChietKhau.Value = objNK.TienChietKhau;
                this.TxtChietKhauNT.Value = objNK.TienChietKhauNT;
                this.TxtTienThue.Value = objNK.TienThueVAT;
                this.TxtTienThueNT.Value = objNK.TienThueVATNT;
                this.TxtDienGiai.Text = objNK.DienGiai;
                this.TxtMaSoThue.Text = objNK.MaSoThue;
                this.TxtTongThanhToan.Value = (Conversions.ToDouble(this.TxtTienHang.Value) - Conversions.ToDouble(this.TxtChietKhau.Value)) + Conversions.ToDouble(this.TxtTienThue.Value);
                this.TxtTongThanhToanNT.Value = (Conversions.ToDouble(this.TxtTienHangNT.Value) - Conversions.ToDouble(this.TxtChietKhauNT.Value)) + Conversions.ToDouble(this.TxtTienThueNT.Value);
                objNK = null;
                this.LoadDetailsDichVu(strKhoa);
            }
        }

        public void TinhChietKhau(int nRow)
        {
            double num = 0.0;
            C1.Win.C1FlexGrid.C1FlexGrid vSList = this.VSList;
            int num2 = Conversions.ToInteger(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(vSList[nRow, 9]), 0, modGeneral.TypeOfValue.Nothing));
            num = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(vSList[nRow, 8]), 0, modGeneral.TypeOfValue.Nothing));
            vSList[nRow, 10] = Math.Round((double) ((num2 * num) / 100.0), 0);
            vSList = null;
        }

        private void TinhThue(int nRow)
        {
            double num = 0.0;
            string strCode = LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.CboLoaiTien.SelectedValue), "", modGeneral.TypeOfValue.String).ToString().Trim();
            if (strCode != "")
            {
                this.objLT.LoadByCode(strCode);
                C1.Win.C1FlexGrid.C1FlexGrid vSList = this.VSList;
                int num3 = Conversions.ToInteger(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(vSList[nRow, 11]), 0, modGeneral.TypeOfValue.Nothing));
                num = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(vSList[nRow, 8]), 0, modGeneral.TypeOfValue.Nothing)) - Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(vSList[nRow, 10]), 0, modGeneral.TypeOfValue.Nothing));
                vSList[nRow, 12] = Math.Round((double) ((num3 * num) / 100.0), this.objLT.SoLe);
                vSList = null;
            }
        }

        public void TinhTienBan(int nRow)
        {
            double num = 0.0;
            double num2 = 0.0;
            C1.Win.C1FlexGrid.C1FlexGrid vSList = this.VSList;
            num = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(vSList[nRow, 7]), 0, modGeneral.TypeOfValue.Nothing));
            num2 = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(vSList[nRow, 6]), 0, modGeneral.TypeOfValue.Nothing));
            vSList[nRow, 8] = Math.Round((double) (num * num2), Conversions.ToInteger(LVYModule.ReturnIfNull(this.objLT.SoLe, 0, modGeneral.TypeOfValue.Nothing)));
            vSList = null;
        }

        public void TinhTienHang(int nRow)
        {
            double num2 = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSList[nRow, 13]), 0, modGeneral.TypeOfValue.Nothing));
            double num = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSList[nRow, 14]), 0, modGeneral.TypeOfValue.Nothing));
            this.VSList[nRow, 15] = num2 * num;
        }

        public void TinhTong()
        {
            double num = 0.0;
            num = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.txtTyGia.Value), 0, modGeneral.TypeOfValue.Nothing));
            this.TxtTienHangNT.Value = LVYModule.SumColGrid(this.VSList, 8);
            this.TxtChietKhauNT.Value = LVYModule.SumColGrid(this.VSList, 10);
            this.TxtTienThueNT.Value = LVYModule.SumColGrid(this.VSList, 12);
            this.TxtTongThanhToanNT.Value = (Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.TxtTienHangNT.Value), 0, modGeneral.TypeOfValue.Nothing)) - Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.TxtChietKhauNT.Value), 0, modGeneral.TypeOfValue.Nothing))) + Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.TxtTienThueNT.Value), 0, modGeneral.TypeOfValue.Nothing));
            this.TxtTienHang.Value = Math.Round((double) (Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.TxtTienHangNT.Value), 0, modGeneral.TypeOfValue.Nothing)) * num), 0);
            this.TxtChietKhau.Value = Math.Round((double) (Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.TxtChietKhauNT.Value), 0, modGeneral.TypeOfValue.Nothing)) * num), 0);
            this.TxtTienThue.Value = Math.Round((double) (Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.TxtTienThueNT.Value), 0, modGeneral.TypeOfValue.Nothing)) * num), 0);
            this.TxtTongThanhToan.Value = Math.Round((double) (Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.TxtTongThanhToanNT.Value), 0, modGeneral.TypeOfValue.Nothing)) * num), 0);
        }

        private void TxtDienGiai_LostFocus(object sender, EventArgs e)
        {
            this.CmdAddRow.Focus();
        }

        private void TxtSoNgayToiHan_LostFocus(object sender, EventArgs e)
        {
            if (this.mEnabledControl)
            {
                double number = Conversions.ToDouble(LVYModule.ReturnIfNull(this.TxtSoNgayToiHan.Text, 0, modGeneral.TypeOfValue.Nothing));
                if (number == 0.0)
                {
                    this.TxtSoNgayToiHan.Text = this.TxtSoNgayToiHan.Text;
                }
                else
                {
                    this.TxtNgayToiHanThanhToan.Text = Strings.Format(DateAndTime.DateAdd(DateInterval.Day, number, Conversions.ToDate(this.TxtNgayToiHanThanhToan.Text)), "dd/MM/yyyy");
                }
            }
        }

        private void TxtSoSeri_KeyPress(object sender, KeyPressEventArgs e)
        {
            e.KeyChar = Conversions.ToChar(e.KeyChar.ToString().ToUpper());
        }

        private void TxtThueSuat_ValueChanged(object sender, EventArgs e)
        {
            if (LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.TxtThueSuat.Value), "", modGeneral.TypeOfValue.Nothing).ToString().Trim() != "")
            {
                int num2 = this.VSList.Rows.Count - 1;
                for (int i = 1; i <= num2; i++)
                {
                    this.VSList[i, 11] = RuntimeHelpers.GetObjectValue(this.TxtThueSuat.Value);
                    RowColEventArgs args = new RowColEventArgs(i, 11);
                    this.VSList_AfterEdit(this.VSList, args);
                }
            }
        }

        public object UpdateData()
        {
            object obj2;
            clsNhapKho objNK = this.objNK;
            objNK.Khoa = this.cFrmKhoa;
            objNK.KhoaDonHang = LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.TxtSoDonHang.Tag), "", modGeneral.TypeOfValue.Nothing).ToString().Trim();
            objNK.NgayDonHang = LVYModule.Date2Char(this.TxtNgayDathang.Text);
            objNK.SoDonHang = LVYModule.ReturnIfNull(this.TxtSoDonHang.Text, "", modGeneral.TypeOfValue.Nothing).ToString().Trim();
            objNK.SoChungTu = LVYModule.ReturnIfNull(this.TxtSoChungTu.Text, "", modGeneral.TypeOfValue.Nothing).ToString().Trim();
            objNK.NgayChungTu = LVYModule.Date2Char(this.TxtNgayChungTu.Text);
            objNK.LoaiTien = this.CboLoaiTien.SelectedValue.ToString().Trim();
            objNK.TyGia = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.txtTyGia.Value), 1, modGeneral.TypeOfValue.Nothing));
            objNK.KhoaDoiTuong = this.AdvNhaCungCap.Value;
            objNK.NguoiGiao = this.TxtNguoiGiao.Text;
            objNK.KhoaLoaiHoaDon = LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.CboLoaiHoaDon.SelectedValue), "", modGeneral.TypeOfValue.Nothing).ToString().Trim();
            objNK.SoHoaDon = LVYModule.ReturnIfNull(this.TxtSoHoaDon.Text, "", modGeneral.TypeOfValue.Nothing).ToString();
            objNK.NgayHoaDon = LVYModule.Date2Char(this.TxtNgayHoaDon.Text);
            objNK.SoSeri = LVYModule.ReturnIfNull(this.TxtSoSeri.Text, "", modGeneral.TypeOfValue.Nothing).ToString().Trim();
            objNK.ThueSuat = Conversions.ToInteger(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.TxtThueSuat.Value), 0, modGeneral.TypeOfValue.Nothing));
            objNK.KhoaTKThanhToan = this.AdvTaiKhoanCo.Value;
            objNK.KhoaTKNoThueVAT = this.AdvTaiKhoanThue.Value;
            objNK.TienHangNT = Conversions.ToDouble(this.TxtTienHangNT.Value);
            objNK.TienHang = Conversions.ToDouble(this.TxtTienHang.Value);
            objNK.TienChietKhau = Conversions.ToDouble(this.TxtChietKhau.Value);
            objNK.TienChietKhauNT = Conversions.ToDouble(this.TxtChietKhauNT.Value);
            objNK.TienThueVAT = Conversions.ToDouble(this.TxtTienThue.Value);
            objNK.TienThueVATNT = Conversions.ToDouble(this.TxtTienThueNT.Value);
            objNK.MaSoThue = this.TxtMaSoThue.Text.Trim();
            objNK.NguonNhap = "DV";
            if (objNK.KhoaNhanVienTao.Trim() == "")
            {
                objNK.KhoaNhanVienTao = modGeneral.H_USERID;
                objNK.NgayTao = LVYModule.Date2Char(Strings.Format(DateAndTime.Today, "dd/MM/yyyy"));
            }
            objNK.KhoaNhanVienSua = modGeneral.H_USERID;
            objNK.NgaySua = LVYModule.Date2Char(Strings.Format(DateAndTime.Today, "dd/MM/yyyy"));
            objNK.KhoaDonVi = modGeneral.H_CLIENT;
            objNK.DienGiai = this.TxtDienGiai.Text;
            objNK.GhiSo = 1;
            objNK.KhoaHangMucBaoCaoThue = Conversions.ToString(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.CboKhaiThue.SelectedValue), "", modGeneral.TypeOfValue.Nothing));
            return objNK.Save();
            objNK = null;
            return obj2;
        }

        private void VSList_AfterEdit(object sender, RowColEventArgs e)
        {
            string expression = "";
            switch (e.Col)
            {
                case 2:
                {
                    expression = SearchModule.SearchTaiKhoan(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSList[e.Row, 2]), "", modGeneral.TypeOfValue.Nothing).ToString(), "", "", "", "");
                    if (expression == "")
                    {
                        this.VSList[e.Row, 1] = "";
                        this.VSList[e.Row, 2] = "";
                        break;
                    }
                    object instance = Strings.Split(expression, "|", -1, CompareMethod.Binary);
                    this.VSList[e.Row, 1] = RuntimeHelpers.GetObjectValue(NewLateBinding.LateIndexGet(instance, new object[] { 0 }, null));
                    this.VSList[e.Row, 2] = RuntimeHelpers.GetObjectValue(NewLateBinding.LateIndexGet(instance, new object[] { 1 }, null));
                    this.VSList.Select(e.Row, 4);
                    break;
                }
                case 8:
                case 9:
                    this.TinhChietKhau(e.Row);
                    this.TinhThue(e.Row);
                    break;

                case 10:
                case 11:
                    this.TinhThue(e.Row);
                    break;
            }
            this.TinhTong();
        }

        private void VSList_BeforeEdit(object sender, RowColEventArgs e)
        {
            if (!this.mEnabledControl)
            {
                e.Cancel = true;
            }
        }

        internal virtual ADVObjects AdvNhaCungCap
        {
            [DebuggerNonUserCode]
            get
            {
                return this._AdvNhaCungCap;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                ADVObjects.ValueChangedEventHandler handler = new ADVObjects.ValueChangedEventHandler(this.AdvNhaCungCap_ValueChanged);
                if (this._AdvNhaCungCap != null)
                {
                    this._AdvNhaCungCap.ValueChanged -= handler;
                }
                this._AdvNhaCungCap = value;
                if (this._AdvNhaCungCap != null)
                {
                    this._AdvNhaCungCap.ValueChanged += handler;
                }
            }
        }

        internal virtual ADVAccount AdvTaiKhoanCo
        {
            [DebuggerNonUserCode]
            get
            {
                return this._AdvTaiKhoanCo;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._AdvTaiKhoanCo = value;
            }
        }

        internal virtual ADVAccount AdvTaiKhoanThue
        {
            [DebuggerNonUserCode]
            get
            {
                return this._AdvTaiKhoanThue;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._AdvTaiKhoanThue = value;
            }
        }

        internal virtual C1DockingTab C1DockingTab1
        {
            [DebuggerNonUserCode]
            get
            {
                return this._C1DockingTab1;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._C1DockingTab1 = value;
            }
        }

        internal virtual C1DockingTab C1DockingTab2
        {
            [DebuggerNonUserCode]
            get
            {
                return this._C1DockingTab2;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._C1DockingTab2 = value;
            }
        }

        internal virtual C1DockingTabPage C1DockingTabPage1
        {
            [DebuggerNonUserCode]
            get
            {
                return this._C1DockingTabPage1;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._C1DockingTabPage1 = value;
            }
        }

        internal virtual C1DockingTabPage C1DockingTabPage2
        {
            [DebuggerNonUserCode]
            get
            {
                return this._C1DockingTabPage2;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._C1DockingTabPage2 = value;
            }
        }

        internal virtual ComboBox CboKhaiThue
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CboKhaiThue;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._CboKhaiThue = value;
            }
        }

        internal virtual ComboBox CboLoaiHoaDon
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CboLoaiHoaDon;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CboLoaiHoaDon_SelectedIndexChanged);
                if (this._CboLoaiHoaDon != null)
                {
                    this._CboLoaiHoaDon.SelectedIndexChanged -= handler;
                }
                this._CboLoaiHoaDon = value;
                if (this._CboLoaiHoaDon != null)
                {
                    this._CboLoaiHoaDon.SelectedIndexChanged += handler;
                }
            }
        }

        internal virtual ComboBox CboLoaiTien
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CboLoaiTien;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CboLoaiTien_SelectedIndexChanged);
                if (this._CboLoaiTien != null)
                {
                    this._CboLoaiTien.SelectedIndexChanged -= handler;
                }
                this._CboLoaiTien = value;
                if (this._CboLoaiTien != null)
                {
                    this._CboLoaiTien.SelectedIndexChanged += handler;
                }
            }
        }

        internal virtual CheckBox CKTheoDoiSeri
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CKTheoDoiSeri;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CKTheoDoiSeri_CheckedChanged);
                if (this._CKTheoDoiSeri != null)
                {
                    this._CKTheoDoiSeri.CheckedChanged -= handler;
                }
                this._CKTheoDoiSeri = value;
                if (this._CKTheoDoiSeri != null)
                {
                    this._CKTheoDoiSeri.CheckedChanged += handler;
                }
            }
        }

        internal virtual ToolStripButton CmdAdd
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdAdd;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdAdd_Click);
                if (this._CmdAdd != null)
                {
                    this._CmdAdd.Click -= handler;
                }
                this._CmdAdd = value;
                if (this._CmdAdd != null)
                {
                    this._CmdAdd.Click += handler;
                }
            }
        }

        internal virtual Button CmdAddRow
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdAddRow;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdAddRow_Click);
                if (this._CmdAddRow != null)
                {
                    this._CmdAddRow.Click -= handler;
                }
                this._CmdAddRow = value;
                if (this._CmdAddRow != null)
                {
                    this._CmdAddRow.Click += handler;
                }
            }
        }

        internal virtual Button CmdCopy
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdCopy;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdCopy_Click);
                if (this._CmdCopy != null)
                {
                    this._CmdCopy.Click -= handler;
                }
                this._CmdCopy = value;
                if (this._CmdCopy != null)
                {
                    this._CmdCopy.Click += handler;
                }
            }
        }

        internal virtual ToolStripButton CmdDel
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdDel;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdDel_Click);
                if (this._CmdDel != null)
                {
                    this._CmdDel.Click -= handler;
                }
                this._CmdDel = value;
                if (this._CmdDel != null)
                {
                    this._CmdDel.Click += handler;
                }
            }
        }

        internal virtual Button CmdDelRow
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdDelRow;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdDelRow_Click);
                if (this._CmdDelRow != null)
                {
                    this._CmdDelRow.Click -= handler;
                }
                this._CmdDelRow = value;
                if (this._CmdDelRow != null)
                {
                    this._CmdDelRow.Click += handler;
                }
            }
        }

        internal virtual ToolStripButton CmdEdit
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdEdit;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdEdit_Click);
                if (this._CmdEdit != null)
                {
                    this._CmdEdit.Click -= handler;
                }
                this._CmdEdit = value;
                if (this._CmdEdit != null)
                {
                    this._CmdEdit.Click += handler;
                }
            }
        }

        internal virtual ToolStripButton CmdExit
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdExit;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdExit_Click);
                if (this._CmdExit != null)
                {
                    this._CmdExit.Click -= handler;
                }
                this._CmdExit = value;
                if (this._CmdExit != null)
                {
                    this._CmdExit.Click += handler;
                }
            }
        }

        internal virtual ToolStripButton CmdFind
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdFind;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdFind_Click);
                if (this._CmdFind != null)
                {
                    this._CmdFind.Click -= handler;
                }
                this._CmdFind = value;
                if (this._CmdFind != null)
                {
                    this._CmdFind.Click += handler;
                }
            }
        }

        internal virtual ToolStripButton cmdHelp
        {
            [DebuggerNonUserCode]
            get
            {
                return this._cmdHelp;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._cmdHelp = value;
            }
        }

        internal virtual ToolStripButton CmdPrint
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdPrint;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdPrint_Click);
                if (this._CmdPrint != null)
                {
                    this._CmdPrint.Click -= handler;
                }
                this._CmdPrint = value;
                if (this._CmdPrint != null)
                {
                    this._CmdPrint.Click += handler;
                }
            }
        }

        internal virtual ToolStripButton CmdSave
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdSave;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdSave_Click);
                if (this._CmdSave != null)
                {
                    this._CmdSave.Click -= handler;
                }
                this._CmdSave = value;
                if (this._CmdSave != null)
                {
                    this._CmdSave.Click += handler;
                }
            }
        }

        internal virtual Button CmdTimDonHang
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdTimDonHang;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdTimDonHang_Click);
                if (this._CmdTimDonHang != null)
                {
                    this._CmdTimDonHang.Click -= handler;
                }
                this._CmdTimDonHang = value;
                if (this._CmdTimDonHang != null)
                {
                    this._CmdTimDonHang.Click += handler;
                }
            }
        }

        internal virtual ToolStripButton CmdUnsave
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdUnsave;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdUnsave_Click);
                if (this._CmdUnsave != null)
                {
                    this._CmdUnsave.Click -= handler;
                }
                this._CmdUnsave = value;
                if (this._CmdUnsave != null)
                {
                    this._CmdUnsave.Click += handler;
                }
            }
        }

        public bool EnabledControl
        {
            get
            {
                return this.mEnabledControl;
            }
            set
            {
                this.mEnabledControl = value;
                this.CmdAdd.Enabled = !value & this.mAllowAdd;
                this.CmdEdit.Enabled = !value & this.mAllowEdit;
                this.CmdSave.Enabled = value;
                this.CmdUnsave.Enabled = value;
                this.CmdDel.Enabled = !value & this.mAllowDel;
                this.CmdFind.Enabled = !value;
                this.CmdExit.Enabled = !value;
                this.CmdAddRow.Enabled = value;
                this.CmdDelRow.Enabled = value;
                this.CmdCopy.Enabled = value;
                this.CmdPrint.Enabled = !value;
                this.TxtSoChungTu.ReadOnly = !value;
                this.TxtNgayChungTu.Enabled = value;
                this.CboLoaiTien.Enabled = value;
                this.txtTyGia.ReadOnly = !value;
                this.TxtDienGiai.ReadOnly = !value;
                this.CboLoaiHoaDon.Enabled = value;
                this.TxtSoHoaDon.ReadOnly = !value;
                this.TxtSoSeri.ReadOnly = !value;
                this.TxtNgayHoaDon.Enabled = value;
                this.TxtNguoiGiao.ReadOnly = !value;
                this.TxtThueSuat.ReadOnly = !value;
                this.AdvNhaCungCap.ReadOnly = !value;
                this.AdvTaiKhoanCo.ReadOnly = !value;
                this.AdvTaiKhoanThue.ReadOnly = !value;
                this.TxtSoNgayToiHan.ReadOnly = !value;
                this.TxtNgayToiHanThanhToan.Enabled = value;
                this.TxtMaSoThue.ReadOnly = !value;
                this.CmdTimDonHang.Enabled = value;
                this.CboKhaiThue.Enabled = value;
            }
        }

        internal virtual Label Label1
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label1;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label1 = value;
            }
        }

        internal virtual Label Label10
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label10;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label10 = value;
            }
        }

        internal virtual Label Label11
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label11;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label11 = value;
            }
        }

        internal virtual Label Label12
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label12;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label12 = value;
            }
        }

        internal virtual Label Label13
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label13;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label13 = value;
            }
        }

        internal virtual Label Label14
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label14;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label14 = value;
            }
        }

        internal virtual Label Label15
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label15;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label15 = value;
            }
        }

        internal virtual Label Label16
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label16;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label16 = value;
            }
        }

        internal virtual Label Label17
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label17;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label17 = value;
            }
        }

        internal virtual Label Label18
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label18;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label18 = value;
            }
        }

        internal virtual Label Label2
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label2;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label2 = value;
            }
        }

        internal virtual Label Label20
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label20;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label20 = value;
            }
        }

        internal virtual Label Label22
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label22;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label22 = value;
            }
        }

        internal virtual Label Label23
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label23;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label23 = value;
            }
        }

        internal virtual Label Label24
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label24;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label24 = value;
            }
        }

        internal virtual Label Label3
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label3;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label3 = value;
            }
        }

        internal virtual Label Label4
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label4;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label4 = value;
            }
        }

        internal virtual Label Label5
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label5;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label5 = value;
            }
        }

        internal virtual Label Label6
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label6;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label6 = value;
            }
        }

        internal virtual Label Label7
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label7;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label7 = value;
            }
        }

        internal virtual Label Label8
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label8;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label8 = value;
            }
        }

        internal virtual Label Label9
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label9;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label9 = value;
            }
        }

        internal virtual LinkLabel LinkLabel1
        {
            [DebuggerNonUserCode]
            get
            {
                return this._LinkLabel1;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                LinkLabelLinkClickedEventHandler handler = new LinkLabelLinkClickedEventHandler(this.LinkLabel1_LinkClicked);
                if (this._LinkLabel1 != null)
                {
                    this._LinkLabel1.LinkClicked -= handler;
                }
                this._LinkLabel1 = value;
                if (this._LinkLabel1 != null)
                {
                    this._LinkLabel1.LinkClicked += handler;
                }
            }
        }

        internal virtual Panel Panel4
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Panel4;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Panel4 = value;
            }
        }

        internal virtual Panel Panel5
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Panel5;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Panel5 = value;
            }
        }

        internal virtual ToolStrip ToolStrip1
        {
            [DebuggerNonUserCode]
            get
            {
                return this._ToolStrip1;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._ToolStrip1 = value;
            }
        }

        internal virtual ToolStripSeparator ToolStripButton1
        {
            [DebuggerNonUserCode]
            get
            {
                return this._ToolStripButton1;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._ToolStripButton1 = value;
            }
        }

        internal virtual ToolStripSeparator ToolStripSeparator1
        {
            [DebuggerNonUserCode]
            get
            {
                return this._ToolStripSeparator1;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._ToolStripSeparator1 = value;
            }
        }

        internal virtual ToolStripSeparator ToolStripSeparator2
        {
            [DebuggerNonUserCode]
            get
            {
                return this._ToolStripSeparator2;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._ToolStripSeparator2 = value;
            }
        }

        internal virtual ToolStripSeparator ToolStripSeparator3
        {
            [DebuggerNonUserCode]
            get
            {
                return this._ToolStripSeparator3;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._ToolStripSeparator3 = value;
            }
        }

        internal virtual C1NumericEdit TxtChietKhau
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtChietKhau;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtChietKhau = value;
            }
        }

        internal virtual C1NumericEdit TxtChietKhauNT
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtChietKhauNT;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtChietKhauNT = value;
            }
        }

        internal virtual TextBox TxtDienGiai
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtDienGiai;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.TxtDienGiai_LostFocus);
                if (this._TxtDienGiai != null)
                {
                    this._TxtDienGiai.LostFocus -= handler;
                }
                this._TxtDienGiai = value;
                if (this._TxtDienGiai != null)
                {
                    this._TxtDienGiai.LostFocus += handler;
                }
            }
        }

        internal virtual TextBox TxtMaSoThue
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtMaSoThue;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtMaSoThue = value;
            }
        }

        internal virtual DateTimePicker TxtNgayChungTu
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtNgayChungTu;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtNgayChungTu = value;
            }
        }

        internal virtual DateTimePicker TxtNgayDathang
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtNgayDathang;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtNgayDathang = value;
            }
        }

        internal virtual DateTimePicker TxtNgayHoaDon
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtNgayHoaDon;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtNgayHoaDon = value;
            }
        }

        internal virtual DateTimePicker TxtNgayToiHanThanhToan
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtNgayToiHanThanhToan;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtNgayToiHanThanhToan = value;
            }
        }

        internal virtual TextBox TxtNguoiGiao
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtNguoiGiao;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtNguoiGiao = value;
            }
        }

        internal virtual TextBox TxtSoChungTu
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtSoChungTu;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtSoChungTu = value;
            }
        }

        internal virtual TextBox TxtSoDonHang
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtSoDonHang;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtSoDonHang = value;
            }
        }

        internal virtual TextBox TxtSoHoaDon
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtSoHoaDon;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtSoHoaDon = value;
            }
        }

        internal virtual TextBox TxtSoNgayToiHan
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtSoNgayToiHan;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.TxtSoNgayToiHan_LostFocus);
                if (this._TxtSoNgayToiHan != null)
                {
                    this._TxtSoNgayToiHan.LostFocus -= handler;
                }
                this._TxtSoNgayToiHan = value;
                if (this._TxtSoNgayToiHan != null)
                {
                    this._TxtSoNgayToiHan.LostFocus += handler;
                }
            }
        }

        internal virtual TextBox TxtSoSeri
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtSoSeri;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                System.Windows.Forms.KeyPressEventHandler handler = new System.Windows.Forms.KeyPressEventHandler(this.TxtSoSeri_KeyPress);
                if (this._TxtSoSeri != null)
                {
                    this._TxtSoSeri.KeyPress -= handler;
                }
                this._TxtSoSeri = value;
                if (this._TxtSoSeri != null)
                {
                    this._TxtSoSeri.KeyPress += handler;
                }
            }
        }

        internal virtual C1NumericEdit TxtThueSuat
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtThueSuat;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.TxtThueSuat_ValueChanged);
                if (this._TxtThueSuat != null)
                {
                    this._TxtThueSuat.ValueChanged -= handler;
                }
                this._TxtThueSuat = value;
                if (this._TxtThueSuat != null)
                {
                    this._TxtThueSuat.ValueChanged += handler;
                }
            }
        }

        internal virtual C1NumericEdit TxtTienHang
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtTienHang;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtTienHang = value;
            }
        }

        internal virtual C1NumericEdit TxtTienHangNT
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtTienHangNT;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtTienHangNT = value;
            }
        }

        internal virtual C1NumericEdit TxtTienThue
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtTienThue;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtTienThue = value;
            }
        }

        internal virtual C1NumericEdit TxtTienThueNT
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtTienThueNT;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtTienThueNT = value;
            }
        }

        internal virtual C1NumericEdit TxtTongThanhToan
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtTongThanhToan;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtTongThanhToan = value;
            }
        }

        internal virtual C1NumericEdit TxtTongThanhToanNT
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtTongThanhToanNT;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtTongThanhToanNT = value;
            }
        }

        internal virtual C1NumericEdit txtTyGia
        {
            [DebuggerNonUserCode]
            get
            {
                return this._txtTyGia;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._txtTyGia = value;
            }
        }

        internal virtual C1.Win.C1FlexGrid.C1FlexGrid VSList
        {
            [DebuggerNonUserCode]
            get
            {
                return this._VSList;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                RowColEventHandler handler = new RowColEventHandler(this.VSList_AfterEdit);
                RowColEventHandler handler2 = new RowColEventHandler(this.VSList_BeforeEdit);
                if (this._VSList != null)
                {
                    this._VSList.AfterEdit -= handler;
                    this._VSList.BeforeEdit -= handler2;
                }
                this._VSList = value;
                if (this._VSList != null)
                {
                    this._VSList.AfterEdit += handler;
                    this._VSList.BeforeEdit += handler2;
                }
            }
        }
    }
}

